The 'used' of free seems unreasonable in some scenarios
low version: Original: Used = Total - Free - Cached - SReclaimable - Buffers
free -m
total used free shared buff/cache available
Mem: 3916 59 3763 1 93 3691
Swap: 0 0 0
high version: Used = Total - Available
used commit: 2184e90d
free -m
total used free shared buff/cache available
Mem: 3916 225 3763 1 93 3691
Swap: 0 0 0
PS:
Available is an estimate of available memory for system, it will consider emergency memory, watermark.
available ~= free_pages - total_reserved + pagecache + SReclaimable, available may be smaller than free_pages.
Update to high version, problem in some scenarios:
-
used
is larger -
used
+free
>total
, it seems unreasonable
So if available
is less than free
, can we consider falling back to Used = Total - Free
or Used = Total - Free - Cached - SReclaimable - Buffers
?
Edited by chunsheng luo