percpu: expose pcpu_nr_empty_pop_pages in pcpu_stats
authorDennis Zhou (Facebook) <dennisszhou@gmail.com>
Sun, 16 Jul 2017 02:23:08 +0000 (22:23 -0400)
committerTejun Heo <tj@kernel.org>
Mon, 17 Jul 2017 14:46:58 +0000 (10:46 -0400)
Percpu memory holds a minimum threshold of pages that are populated
in order to serve atomic percpu memory requests. This change makes it
easier to verify that there are a minimum number of populated pages
lying around.

Signed-off-by: Dennis Zhou <dennisszhou@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
mm/percpu-internal.h
mm/percpu-stats.c
mm/percpu.c

index cd2442e13d8f5add724bb6be9de1c3dc2ae8f715..c9158a48ca058fc0aa98573efb58773070d49cc0 100644 (file)
@@ -36,6 +36,7 @@ extern spinlock_t pcpu_lock;
 
 extern struct list_head *pcpu_slot;
 extern int pcpu_nr_slots;
+extern int pcpu_nr_empty_pop_pages;
 
 extern struct pcpu_chunk *pcpu_first_chunk;
 extern struct pcpu_chunk *pcpu_reserved_chunk;
index fa0f5de26c68083c085213bd0800ba35d4c9c2ba..44e561d3ab477733750198a23ebe3e44afb73d5d 100644 (file)
@@ -164,6 +164,7 @@ alloc_buffer:
        PU(nr_max_chunks);
        PU(min_alloc_size);
        PU(max_alloc_size);
+       P("empty_pop_pages", pcpu_nr_empty_pop_pages);
        seq_putc(m, '\n');
 
 #undef PU
index bd4130a69bbc9b6b631baf911e66aab31f08b6e0..9ec5fd498f1d529692f5222ec7d2226ea5d968ca 100644 (file)
@@ -160,7 +160,7 @@ static LIST_HEAD(pcpu_map_extend_chunks);
  * The number of empty populated pages, protected by pcpu_lock.  The
  * reserved chunk doesn't contribute to the count.
  */
-static int pcpu_nr_empty_pop_pages;
+int pcpu_nr_empty_pop_pages;
 
 /*
  * Balance work is used to populate or destroy chunks asynchronously.  We