diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 6e45b0f..d2bbd85 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(nr_node_ids * sizeof(unsigned int), + GFP_KERNEL); + if (!counters) + return; + + for (nr = 0; nr < v->nr_pages; nr++) + counters[page_to_nid(v->pages[nr])]++; + + for_each_node_state(nr, N_HIGH_MEMORY) + 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; }