diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 6e45b0f..d1e6594 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -931,6 +931,27 @@ static void s_stop(struct seq_file *m, void *p) read_unlock(&vmlist_lock); } +static void show_numa_infos(struct seq_file *m, struct vm_struct *v) +{ + if (NUMA_BUILD) { + unsigned int *counters, nr; + + counters = kzalloc(MAX_NUMNODES * sizeof(unsigned int), + GFP_KERNEL); + if (!counters) + return; + + for (nr = 0; nr < v->nr_pages; nr++) + counters[page_to_nid(v->pages[nr])]++; + + for (nr = 0; nr < MAX_NUMNODES; nr++) + if (counters[nr]) + seq_printf(m, " N%u=%u", nr, counters[nr]); + + kfree(counters); + } +} + static int s_show(struct seq_file *m, void *p) { struct vm_struct *v = p; @@ -967,6 +988,7 @@ static int s_show(struct seq_file *m, void *p) if (v->flags & VM_VPAGES) seq_printf(m, " vpages"); + show_numa_infos(m, v); seq_putc(m, '\n'); return 0; }