lkml.org 
[lkml]   [2008]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vmallocinfo: Add NUMA informations
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.






\
 
 \ /
  Last update: 2008-06-02 09:13    [from the cache]
©2003-2011 Jasper Spaans