[PATCH] oprofile : Use vmalloc_node() in alloc_cpu_buffers()

From: Eric Dumazet
Date: Fri Nov 25 2005 - 08:36:43 EST


This small patch makes oprofile alloc_cpu_buffers() function NUMA aware, allocating each CPU local buffer in its memory node if possible.

Signed-off-by: Eric Dumazet <dada1@xxxxxxxxxxxxx>

--- linux-2.6-orig/drivers/oprofile/cpu_buffer.c 2005-11-25 10:24:00.000000000 +0100
+++ linux-2.6/drivers/oprofile/cpu_buffer.c 2005-11-25 14:29:04.000000000 +0100
@@ -52,7 +52,8 @@
for_each_online_cpu(i) {
struct oprofile_cpu_buffer * b = &cpu_buffer[i];

- b->buffer = vmalloc(sizeof(struct op_sample) * buffer_size);
+ b->buffer = vmalloc_node(sizeof(struct op_sample) * buffer_size,
+ cpu_to_node(i));
if (!b->buffer)
goto fail;