[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1257262540.26028.3336.camel@gandalf.stny.rr.com>
Date: Tue, 03 Nov 2009 10:35:40 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Ingo Molnar <mingo@...e.hu>,
Frederic Weisbecker <fweisbec@...il.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ringbuffer: synchronize for resizing
On Tue, 2009-11-03 at 19:42 +0800, Lai Jiangshan wrote:
> We got a sudden panic when we reduced the size of the
> ringbuffer.
>
> We can reproduce the panic by the following steps:
>
> echo 1 > events/sched/enable
> cat trace_pipe > /dev/null &
>
> while ((1))
> do
> echo 12000 > buffer_size_kb
> echo 512 > buffer_size_kb
> done
>
> (not more than 5 seconds, panic ...)
Thanks! I'll push this out for inclusion right away.
-- Steve
>
> Reported-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
> ---
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 63446f1..db223fe 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -1196,6 +1196,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
> atomic_inc(&cpu_buffer->record_disabled);
> synchronize_sched();
>
> + spin_lock_irq(&cpu_buffer->reader_lock);
> rb_head_page_deactivate(cpu_buffer);
>
> for (i = 0; i < nr_pages; i++) {
> @@ -1210,6 +1211,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
> return;
>
> rb_reset_cpu(cpu_buffer);
> + spin_unlock_irq(&cpu_buffer->reader_lock);
>
> rb_check_pages(cpu_buffer);
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists