Re: [PATCH] vmallocinfo: Add NUMA informations

From: KOSAKI Motohiro
Date: Mon Jun 02 2008 - 03:09:55 EST


Hi

> Christoph recently added /proc/vmallocinfo file to get information about
> vmalloc allocations.
>
> This patch adds NUMA specific information, giving number of pages
> allocated on each memory node.
>
> This should help to check that vmalloc() is able to respect NUMA policies.

good patch :)


> +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]);
> +

for_each_node_state(n, N_HIGH_MEMORY) is better?
because MAX_NUMNODES has offten very large value.




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/