aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 6e45b0f3d125..35f293816294 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -931,6 +931,25 @@ static void s_stop(struct seq_file *m, void *p)
931 read_unlock(&vmlist_lock); 931 read_unlock(&vmlist_lock);
932} 932}
933 933
934static void show_numa_info(struct seq_file *m, struct vm_struct *v)
935{
936 if (NUMA_BUILD) {
937 unsigned int nr, *counters = m->private;
938
939 if (!counters)
940 return;
941
942 memset(counters, 0, nr_node_ids * sizeof(unsigned int));
943
944 for (nr = 0; nr < v->nr_pages; nr++)
945 counters[page_to_nid(v->pages[nr])]++;
946
947 for_each_node_state(nr, N_HIGH_MEMORY)
948 if (counters[nr])
949 seq_printf(m, " N%u=%u", nr, counters[nr]);
950 }
951}
952
934static int s_show(struct seq_file *m, void *p) 953static int s_show(struct seq_file *m, void *p)
935{ 954{
936 struct vm_struct *v = p; 955 struct vm_struct *v = p;
@@ -967,6 +986,7 @@ static int s_show(struct seq_file *m, void *p)
967 if (v->flags & VM_VPAGES) 986 if (v->flags & VM_VPAGES)
968 seq_printf(m, " vpages"); 987 seq_printf(m, " vpages");
969 988
989 show_numa_info(m, v);
970 seq_putc(m, '\n'); 990 seq_putc(m, '\n');
971 return 0; 991 return 0;
972} 992}