* [4.13-rc1] /proc/meminfo reports that Slab: is little used.
@ 2017-07-26 6:28 Tetsuo Handa
2017-07-27 16:23 ` Johannes Weiner
0 siblings, 1 reply; 6+ messages in thread
From: Tetsuo Handa @ 2017-07-26 6:28 UTC (permalink / raw)
To: Johannes Weiner
Cc: Josef Bacik, Michal Hocko, Vladimir Davydov, Rik van Riel, linux-mm
Commit 385386cff4c6f047 ("mm: vmstat: move slab statistics from zone to
node counters") broke "Slab:" field of /proc/meminfo . It shows nearly 0kB.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [4.13-rc1] /proc/meminfo reports that Slab: is little used.
2017-07-26 6:28 [4.13-rc1] /proc/meminfo reports that Slab: is little used Tetsuo Handa
@ 2017-07-27 16:23 ` Johannes Weiner
2017-07-27 22:23 ` Tetsuo Handa
2017-07-28 9:07 ` Michal Hocko
0 siblings, 2 replies; 6+ messages in thread
From: Johannes Weiner @ 2017-07-27 16:23 UTC (permalink / raw)
To: Tetsuo Handa
Cc: Josef Bacik, Michal Hocko, Vladimir Davydov, Rik van Riel, linux-mm
On Wed, Jul 26, 2017 at 03:28:48PM +0900, Tetsuo Handa wrote:
> Commit 385386cff4c6f047 ("mm: vmstat: move slab statistics from zone to
> node counters") broke "Slab:" field of /proc/meminfo . It shows nearly 0kB.
Thanks for the report. Can you confirm the below fixes the issue?
---
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [4.13-rc1] /proc/meminfo reports that Slab: is little used.
2017-07-27 16:23 ` Johannes Weiner
@ 2017-07-27 22:23 ` Tetsuo Handa
2017-07-28 9:07 ` Michal Hocko
1 sibling, 0 replies; 6+ messages in thread
From: Tetsuo Handa @ 2017-07-27 22:23 UTC (permalink / raw)
To: hannes; +Cc: josef, mhocko, vdavydov.dev, riel, linux-mm
Johannes Weiner wrote:
> On Wed, Jul 26, 2017 at 03:28:48PM +0900, Tetsuo Handa wrote:
> > Commit 385386cff4c6f047 ("mm: vmstat: move slab statistics from zone to
> > node counters") broke "Slab:" field of /proc/meminfo . It shows nearly 0kB.
>
> Thanks for the report. Can you confirm the below fixes the issue?
Yes, this fixed the issue.
Tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Thank you.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [4.13-rc1] /proc/meminfo reports that Slab: is little used.
2017-07-27 16:23 ` Johannes Weiner
2017-07-27 22:23 ` Tetsuo Handa
@ 2017-07-28 9:07 ` Michal Hocko
2017-07-28 13:05 ` Johannes Weiner
1 sibling, 1 reply; 6+ messages in thread
From: Michal Hocko @ 2017-07-28 9:07 UTC (permalink / raw)
To: Johannes Weiner
Cc: Tetsuo Handa, Josef Bacik, Vladimir Davydov, Rik van Riel, linux-mm
On Thu 27-07-17 12:23:55, Johannes Weiner wrote:
> >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?
---
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [4.13-rc1] /proc/meminfo reports that Slab: is little used.
2017-07-28 9:07 ` Michal Hocko
@ 2017-07-28 13:05 ` Johannes Weiner
2017-07-28 13:34 ` Michal Hocko
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Weiner @ 2017-07-28 13:05 UTC (permalink / raw)
To: Michal Hocko
Cc: Tetsuo Handa, Josef Bacik, Vladimir Davydov, Rik van Riel, linux-mm
On Fri, Jul 28, 2017 at 11:07:51AM +0200, Michal Hocko wrote:
> On Thu 27-07-17 12:23:55, Johannes Weiner wrote:
> > >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>
Thanks
> From: Michal Hocko <mhocko@suse.com>
> Date: Fri, 28 Jul 2017 11:02:51 +0200
> Subject: [PATCH] mm: rename global_page_state to global_zone_page_state
>
> global_page_state is error prone as a recent bug report pointed out [1].
> It only returns proper values for zone based counters as the enum it
> gets suggests. We already have global_node_page_state so let's rename
> global_page_state to global_zone_page_state to be more explicit here.
> All existing users seems to be correct
> $ 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
>
> This patch shouldn't introduce any functional change.
>
> [1] http://lkml.kernel.org/r/201707260628.v6Q6SmaS030814@www262.sakura.ne.jp
>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
Yeah I think that's a good idea. I suspect Mel wanted to keep churn in
unrelated callsites down when he introduced the node stuff, since that
was already a big patch series. It makes sense to clean this up now.
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [4.13-rc1] /proc/meminfo reports that Slab: is little used.
2017-07-28 13:05 ` Johannes Weiner
@ 2017-07-28 13:34 ` Michal Hocko
0 siblings, 0 replies; 6+ messages in thread
From: Michal Hocko @ 2017-07-28 13:34 UTC (permalink / raw)
To: Johannes Weiner
Cc: Tetsuo Handa, Josef Bacik, Vladimir Davydov, Rik van Riel, linux-mm
On Fri 28-07-17 09:05:17, Johannes Weiner wrote:
> On Fri, Jul 28, 2017 at 11:07:51AM +0200, Michal Hocko wrote:
[...]
> > From: Michal Hocko <mhocko@suse.com>
> > Date: Fri, 28 Jul 2017 11:02:51 +0200
> > Subject: [PATCH] mm: rename global_page_state to global_zone_page_state
> >
> > global_page_state is error prone as a recent bug report pointed out [1].
> > It only returns proper values for zone based counters as the enum it
> > gets suggests. We already have global_node_page_state so let's rename
> > global_page_state to global_zone_page_state to be more explicit here.
> > All existing users seems to be correct
> > $ 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
> >
> > This patch shouldn't introduce any functional change.
> >
> > [1] http://lkml.kernel.org/r/201707260628.v6Q6SmaS030814@www262.sakura.ne.jp
> >
> > Signed-off-by: Michal Hocko <mhocko@suse.com>
>
> Yeah I think that's a good idea. I suspect Mel wanted to keep churn in
> unrelated callsites down when he introduced the node stuff, since that
> was already a big patch series. It makes sense to clean this up now.
yeah that would make sense.
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Thanks! Could you post both patches when sending to Andrew, please?
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-07-28 13:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 6:28 [4.13-rc1] /proc/meminfo reports that Slab: is little used Tetsuo Handa
2017-07-27 16:23 ` Johannes Weiner
2017-07-27 22:23 ` Tetsuo Handa
2017-07-28 9:07 ` Michal Hocko
2017-07-28 13:05 ` Johannes Weiner
2017-07-28 13:34 ` Michal Hocko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.