[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1109191644190.19059@router.home>
Date: Mon, 19 Sep 2011 16:49:47 -0500 (CDT)
From: Christoph Lameter <cl@...two.org>
To: Steven Rostedt <rostedt@...dmis.org>
cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [RFC][PATCH 0/5] Introduce checks for preemptable code for
this_cpu_read/write()
On Mon, 19 Sep 2011, Steven Rostedt wrote:
> I just found out that the this_cpu_*() functions do not perform the
> test to see if the usage is in atomic or not. Thus, the blind
> conversion of the per_cpu(*, smp_processor_id()) and the get_cpu_var()
> code to this_cpu_*() introduce the regression to detect the hard
> to find case where a per cpu variable is used in preempt code that
> migrates and causes bugs.
this_cpu_* function can be used either way. There is no point in checking
for atomic or not since the this_cpu_* implementations are required to
take care of disabling preemption. Those operations are generally safe to
use regardless of the context.
It can be replaced by __this_cpu_* only when we know that the context
prevents races through disabling preemption.
--
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