[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1314060540.15704.143.camel@gandalf.stny.rr.com>
Date: Mon, 22 Aug 2011 20:49:00 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Vaibhav Nagarnaik <vnagarnaik@...gle.com>
Cc: Michael Rubin <mrubin@...gle.com>,
David Sharp <dhsharp@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] trace: Add per_cpu ring buffer control files
On Mon, 2011-08-22 at 15:09 -0700, Vaibhav Nagarnaik wrote:
>
> @@ -3740,10 +3757,6 @@ int ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
> !cpumask_test_cpu(cpu, buffer_b->cpumask))
> goto out;
>
> - /* At least make sure the two buffers are somewhat the same */
> - if (buffer_a->pages != buffer_b->pages)
> - goto out;
> -
> ret = -EAGAIN;
>
> if (ring_buffer_flags != RB_BUFFERS_ON)
> @@ -3758,6 +3771,12 @@ int ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
> cpu_buffer_a = buffer_a->buffers[cpu];
> cpu_buffer_b = buffer_b->buffers[cpu];
I would move the cpu_buffer_(ab) assignments up instead, as I want the
EINVAL to have dominance. The record_disable just says that we are
temporarily out of commission, when in fact it could be invalid. Thus
the invalid conditions need to be treated first.
-- Steve
>
> + ret = -EINVAL;
> + /* At least make sure the two buffers are somewhat the same */
> + if (cpu_buffer_a->pages != cpu_buffer_b->pages)
> + goto out;
> +
> + ret = -EAGAIN;
> if (atomic_read(&cpu_buffer_a->record_disabled))
> goto out;
>
--
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