Thread (6 messages) 6 messages, 3 authors, 2017-07-28

Re: [4.13-rc1] /proc/meminfo reports that Slab: is little used.

From: Michal Hocko <mhocko@suse.com>
Date: 2017-07-28 09:07:54

On Thu 27-07-17 12:23:55, Johannes Weiner wrote:
quoted
From 14e3d7647b3cf524dbb005faaea96b00b6909c12 Mon Sep 17 00:00:00 2001
From: Johannes Weiner <hannes@cmpxchg.org>
Date: Thu, 27 Jul 2017 11:59:38 -0400
Subject: [PATCH] mm: fix global NR_SLAB_.*CLAIMABLE counter reads

As Tetsuo points out:

    Commit 385386cff4c6f047 ("mm: vmstat: move slab statistics from
    zone to node counters") broke "Slab:" field of /proc/meminfo . It
    shows nearly 0kB.

In addition to /proc/meminfo, this problem also affects the slab
counters OOM/allocation failure info dumps, can cause early -ENOMEM
from overcommit protection, and miscalculate image size requirements
during suspend-to-disk.

This is because the patch in question switched the slab counters from
the zone level to the node level, but forgot to update the global
accessor functions to read the aggregate node data instead of the
aggregate zone data.

Use global_node_page_state() to access the global slab counters.

Fixes: 385386cff4c6 ("mm: vmstat: move slab statistics from zone to node counters")
Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Looks good to me

Acked-by: Michal Hocko <mhocko@suse.com>

... but global_page_state still seems to be very confusing.  Do we want
s@global_page_state@global_zone_page_state@? This would be in line with
per-node statistics. Remaining callers
$ git grep "global_page_state(NR_" | sed 's@.*(\(NR_[A-Z_]*\)).*@\1@' | sort | uniq -c
      2 NR_BOUNCE
      2 NR_FREE_CMA_PAGES
     11 NR_FREE_PAGES
      1 NR_KERNEL_STACK_KB
      1 NR_MLOCK
      2 NR_PAGETABLE

seem to all be using it correctly. So what do you think about the follow
up?
---
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help