mm: vmstat: get slab statistics always from node counters
authorStefan Agner <stefan@agner.ch>
Sun, 6 Aug 2017 23:42:21 +0000 (16:42 -0700)
committerStefan Agner <stefan@agner.ch>
Mon, 7 Aug 2017 06:21:11 +0000 (23:21 -0700)
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
mm/page_alloc.c

index 222317721c5a09291c6b78fc839e722b2196b177..0972a8e09d082d99c7f197cbe6bd4fdb6475ba33 100644 (file)
@@ -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)
index fc32aa81f3593537cc2b11d5f63b5c5f517097a4..cc903d969d00e0f568fe665831bcb056add23123 100644 (file)
@@ -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),