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

  • From: OmegaPhil <OmegaPhil@xxxxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Sat, 28 Nov 2015 18:29:31 +0000

On 25/10/15 19:51, OmegaPhil wrote:

On 24/10/15 04:36, Craig Small wrote:
On Sun, Oct 11, 2015 at 06:19:24PM +0100, OmegaPhil wrote:
Since this has apparently gone nowhere, I've had a look into this
- 'Available' is a new stat added in January 2014 which aims to
give the users a figure of memory available that, once used, will
cause kswapd to start swapping pages out - here is the commit
adding it:

https://github.com/torvalds/linux/commit/34e431b0ae398fc54ea69ff85ec700722c9da773


That's an interesting read. It probably means used should be total -
available.


Separate to this, the available calculation
(fs/proc/meminfo.c:meminfo_proc_show) only takes into account
NR_SLAB_RECLAIMABLE and therefore ignores NR_SLAB_UNRECLAIMABLE -
this
I have now changed so that cached only includes reclaimable. This is
in both the master and newlib branches. Thanks for your digging on
this to find some references.

https://gitlab.com/procps-ng/procps/commit/05d751c4f076a2f0118b914c5e51cfbb4762ad8e

- Craig

Cheers. Now to get htop fixed...


Right, I now have a further example of Cached's brokenness - it turns
out that System V shared memory, non file-backed mmap'd memory and
normal tmpfs usage (essentially all examples of tmpfs usage) are wrongly
included in Cached from meminfo, simply as they are dumped in the page
cache (but they can't be evicted since they aren't backed by a file,
hence thats not a cache for me) - I've written up more on this here[0]
when trying to justify what conky was doing - basically Shmem
(kb_main_shared) needs to be removed from Cached (kb_page_cache).

For an example of the scope of the failure, on this 32GB RAM machine
with 4d uptime and 9.15GB RAM used, 155MB is used in shared memory.

Thanks

0: https://github.com/brndnmtthws/conky/issues/130#issuecomment-160321724



Attachment: signature.asc
Description: OpenPGP digital signature

Other related posts: