lkml.org 
[lkml]   [2012]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] RCU changes for v3.4
On Fri, Mar 23, 2012 at 9:17 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
>
> I must admit that __this_cpu_inc() would be nicer than __this_cpu_add(),
> though, will fix.  I need the leading "__" to avoid disabling preemption
> needlessly on non-x86 platforms.

Yeah, that's just bogus. Ok on that.

> The reason that the "__raw" forms are
> safe in this case is because the per-CPU variable is saved and restored
> at context-switch time.
>
> Or am I still missing something here?

It's not that the "__raw" forms are "safe". It's that they are SH*T.

Don't use them. They are crap. Why would you do

+ __raw_get_cpu_var(rcu_read_lock_nesting) =
+ current->rcu_read_lock_nesting_save;

which is just crazy and cannot use the actual sane "%fs:" segment
overrides, but instead has to do idiotic "ready the per-cpu offset
pointer and add it in".

We've got "__this_cpu_write()" which generates the correct code.

Rule of thumb: there is _never_ any good reason to use
__raw_get_cpu_var. It's a broken interface.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-03-24 05:29    [W:0.178 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site