[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <25599.1316557072@turing-police.cc.vt.edu>
Date: Tue, 20 Sep 2011 18:17:52 -0400
From: Valdis.Kletnieks@...edu
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Christoph Lameter <cl@...two.org>, 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 11:19:47 EDT, Steven Rostedt said:
> 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!
This has the added advantage of making the calling function take the blame
in latency traces, doesn't it?
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists