[procps] Re: [OmegaPhil@xxxxxxxxxxxxx: Bug#799716: free considers 'cached' to include SUnreclaim]

  • From: OmegaPhil <OmegaPhil@xxxxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Thu, 14 Jan 2016 19:23:13 +0000

On 13/01/16 16:10, Jaromir Capik wrote:


I'm going into this without re-familiarising and looking at some ~v4.1
kernel source, but looking at fs/proc/meminfo.c:meminfo_proc_show, I
think the reason I didn't jump on Available as The Solution previously was:

o It mentions the amount of available RAM before the system starts to
swap - thats not really the question I'm interested in, otherwise you'd
need to factor in vm swappiness in - the question is literally, 'what
free memory is available', so attempting to allocate 1MB with <1MB free
would lead to OOM killing etc.

You're right, the description is not accurate. I believe it is valid for
the worst case scenario with vm swappiness 0. The description says it's
just an estimation, but it's more useful than the pervasive math with
cached, that was used by the users for years :] It's also the reason
why the "-/+ buffers/cache" line was removed from the 'free' tool.


o The pagecache calculation is extremely vague, its literally guessing here:

'Assume at least half of the page cache, or the
* low watermark worth of cache, needs to stay'

And this goes back to the previous problem - if lots of shmem is used
and is not reclaimable, this is in the page cache and is therefore
invalidly regarded as 'available' - am I reading this wrong?

Yes, you're reading it wrong. Try to create a big file in tmpfs
and then check the MemAvailable. You'll see it decreasing.
AFAIK the unreclaimable parts of cache are excluded and the
MemAvailable only considers parts of the cache which can be
released by the system automatically when the amount of free memory
gets low.

Regards,
Jaromir.


Thanks - I am queuing up another look at this so I can answer stuff
properly - the tmpfs/shmem stuff is based off this blog article:

http://calimeroteknik.free.fr/blag/?article20/really-used-memory-on-gnu-linux

When I reach this I'll recreate what hes doing there.


Attachment: signature.asc
Description: OpenPGP digital signature

Other related posts: