]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ring_buffer: map to cpu not page
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 2 Oct 2008 23:18:09 +0000 (19:18 -0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 14 Oct 2008 08:39:15 +0000 (10:39 +0200)
My original patch had a compile bug when NUMA was configured. I
referenced cpu when it should have been cpu_buffer->cpu.

Ingo quickly fixed this bug by replacing cpu with 'i' because that
was the loop counter. Unfortunately, the 'i' was the counter of
pages, not CPUs. This caused a crash when the number of pages allocated
for the buffers exceeded the number of pages, which would usually
be the case.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/ring_buffer.c

index 54a30986493a3602800a1c9eb3e3b0458d4a40e4..6b8dac02364f602a377220728ea0f3e77280b472 100644 (file)
@@ -232,7 +232,7 @@ static int rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
 
        for (i = 0; i < nr_pages; i++) {
                page = kzalloc_node(ALIGN(sizeof(*page), cache_line_size()),
-                                   GFP_KERNEL, cpu_to_node(i));
+                                   GFP_KERNEL, cpu_to_node(cpu_buffer->cpu));
                if (!page)
                        goto free_pages;
                list_add(&page->list, &pages);