[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1109201108080.8056@router.home>
Date: Tue, 20 Sep 2011 11:08:56 -0500 (CDT)
From: Christoph Lameter <cl@...two.org>
To: Steven Rostedt <rostedt@...dmis.org>
cc: Valdis.Kletnieks@...edu, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [RFC][PATCH 0/5] Introduce checks for preemptable code for
this_cpu_read/write()
On Tue, 20 Sep 2011, Steven Rostedt wrote:
> On Tue, 2011-09-20 at 09:57 -0500, Christoph Lameter wrote:
>
> > this_cpu_xx functions are made for those locations that have
> > preemption enabled. If you can use those function (classic case is a
> > per cpu counter increment in the network subsystem) then you can avoid
> > preempt disable/enable or get_cpu/put_cpu.
>
> If the variables are used for a very short time, then the latencies
> introduced by a simple:
>
> var = get_cpu_var(my_var);
> if (var)
> do_something_quick();
> put_cpu_var(my_var);
>
> Otherwise if that do_something_quick(); migrates, it may be doing
> something it shouldn't be doing!
That is obviously a use case in which this_cpu_xx ops could not be used
since we must stay on the same cpu. I think there is still a lot of
confusion on your part. The example here shows it.
--
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