]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/vmalloc.c
vmallocinfo: add NUMA information
[linux-2.6-omap-h63xx.git] / mm / vmalloc.c
index 6e45b0f3d1256e0bdc3a3caffa74597cf96a5138..35f2938162948b02003007c31686f1b58d7af542 100644 (file)
@@ -931,6 +931,25 @@ static void s_stop(struct seq_file *m, void *p)
        read_unlock(&vmlist_lock);
 }
 
+static void show_numa_info(struct seq_file *m, struct vm_struct *v)
+{
+       if (NUMA_BUILD) {
+               unsigned int nr, *counters = m->private;
+
+               if (!counters)
+                       return;
+
+               memset(counters, 0, nr_node_ids * sizeof(unsigned int));
+
+               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]);
+       }
+}
+
 static int s_show(struct seq_file *m, void *p)
 {
        struct vm_struct *v = p;
@@ -967,6 +986,7 @@ static int s_show(struct seq_file *m, void *p)
        if (v->flags & VM_VPAGES)
                seq_printf(m, " vpages");
 
+       show_numa_info(m, v);
        seq_putc(m, '\n');
        return 0;
 }