* [PATCH] mm: vmstat: get slab statistics always from node counters
@ 2017-08-07 0:04 Stefan Agner
2017-08-07 7:06 ` Michal Hocko
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Agner @ 2017-08-07 0:04 UTC (permalink / raw)
To: hannes, akpm; +Cc: torvalds, linux-mm, linux-kernel, Stefan Agner
After the move of slab statistics from zone to node counters some
users still try to get the counters from the zone counters. This has
been caught while compiling with clang printing a warning like:
implicit conversion from enumeration type 'enum node_stat_item' to
different enumeration type 'enum zone_stat_item' [-Wenum-conversion]
Fixes: 385386cff4 ("mm: vmstat: move slab statistics from zone to node counters")
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
kernel/power/snapshot.c | 2 +-
mm/page_alloc.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 222317721c5a..0972a8e09d08 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1650,7 +1650,7 @@ static unsigned long minimum_image_size(unsigned long saveable)
{
unsigned long size;
- size = global_page_state(NR_SLAB_RECLAIMABLE)
+ size = global_node_page_state(NR_SLAB_RECLAIMABLE)
+ global_node_page_state(NR_ACTIVE_ANON)
+ global_node_page_state(NR_INACTIVE_ANON)
+ global_node_page_state(NR_ACTIVE_FILE)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6d30e914afb6..10aa91b58487 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4458,8 +4458,8 @@ long si_mem_available(void)
* Part of the reclaimable slab consists of items that are in use,
* and cannot be freed. Cap this estimate at the low watermark.
*/
- available += global_page_state(NR_SLAB_RECLAIMABLE) -
- min(global_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low);
+ available += global_node_page_state(NR_SLAB_RECLAIMABLE) -
+ min(global_node_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low);
if (available < 0)
available = 0;
@@ -4602,8 +4602,8 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
global_node_page_state(NR_FILE_DIRTY),
global_node_page_state(NR_WRITEBACK),
global_node_page_state(NR_UNSTABLE_NFS),
- global_page_state(NR_SLAB_RECLAIMABLE),
- global_page_state(NR_SLAB_UNRECLAIMABLE),
+ global_node_page_state(NR_SLAB_RECLAIMABLE),
+ global_node_page_state(NR_SLAB_UNRECLAIMABLE),
global_node_page_state(NR_FILE_MAPPED),
global_node_page_state(NR_SHMEM),
global_page_state(NR_PAGETABLE),
--
2.13.3
--
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] 2+ messages in thread
* Re: [PATCH] mm: vmstat: get slab statistics always from node counters
2017-08-07 0:04 [PATCH] mm: vmstat: get slab statistics always from node counters Stefan Agner
@ 2017-08-07 7:06 ` Michal Hocko
0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2017-08-07 7:06 UTC (permalink / raw)
To: Stefan Agner; +Cc: hannes, akpm, torvalds, linux-mm, linux-kernel
On Sun 06-08-17 17:04:09, Stefan Agner wrote:
> After the move of slab statistics from zone to node counters some
> users still try to get the counters from the zone counters. This has
> been caught while compiling with clang printing a warning like:
>
> implicit conversion from enumeration type 'enum node_stat_item' to
> different enumeration type 'enum zone_stat_item' [-Wenum-conversion]
>
> Fixes: 385386cff4 ("mm: vmstat: move slab statistics from zone to node counters")
> Signed-off-by: Stefan Agner <stefan@agner.ch>
Johannes has posted the fix already
http://lkml.kernel.org/r/20170801134256.5400-1-hannes@cmpxchg.org
Thanks!
> ---
> kernel/power/snapshot.c | 2 +-
> mm/page_alloc.c | 8 ++++----
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
> index 222317721c5a..0972a8e09d08 100644
> --- a/kernel/power/snapshot.c
> +++ b/kernel/power/snapshot.c
> @@ -1650,7 +1650,7 @@ static unsigned long minimum_image_size(unsigned long saveable)
> {
> unsigned long size;
>
> - size = global_page_state(NR_SLAB_RECLAIMABLE)
> + size = global_node_page_state(NR_SLAB_RECLAIMABLE)
> + global_node_page_state(NR_ACTIVE_ANON)
> + global_node_page_state(NR_INACTIVE_ANON)
> + global_node_page_state(NR_ACTIVE_FILE)
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 6d30e914afb6..10aa91b58487 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4458,8 +4458,8 @@ long si_mem_available(void)
> * Part of the reclaimable slab consists of items that are in use,
> * and cannot be freed. Cap this estimate at the low watermark.
> */
> - available += global_page_state(NR_SLAB_RECLAIMABLE) -
> - min(global_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low);
> + available += global_node_page_state(NR_SLAB_RECLAIMABLE) -
> + min(global_node_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low);
>
> if (available < 0)
> available = 0;
> @@ -4602,8 +4602,8 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
> global_node_page_state(NR_FILE_DIRTY),
> global_node_page_state(NR_WRITEBACK),
> global_node_page_state(NR_UNSTABLE_NFS),
> - global_page_state(NR_SLAB_RECLAIMABLE),
> - global_page_state(NR_SLAB_UNRECLAIMABLE),
> + global_node_page_state(NR_SLAB_RECLAIMABLE),
> + global_node_page_state(NR_SLAB_UNRECLAIMABLE),
> global_node_page_state(NR_FILE_MAPPED),
> global_node_page_state(NR_SHMEM),
> global_page_state(NR_PAGETABLE),
> --
> 2.13.3
>
> --
> 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>
--
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] 2+ messages in thread
end of thread, other threads:[~2017-08-07 7:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 0:04 [PATCH] mm: vmstat: get slab statistics always from node counters Stefan Agner
2017-08-07 7:06 ` Michal Hocko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox