Re: [GIT PULL] RCU changes for v3.4

From: Linus Torvalds
Date: Fri Mar 23 2012 - 22:01:20 EST


On Fri, Mar 23, 2012 at 6:47 PM, Paul E. McKenney
<paulmck@xxxxxxxxxxxxxxxxxx> wrote:
>
> This is what I get on a 32-bit build, according to objdump:
>
>        24e3:       64 ff 05 00 00 00 00    incl   %fs:0x0

You do? I'm surprised:

> +static inline void __rcu_read_lock(void)
> +{
> +       __raw_get_cpu_var(rcu_read_lock_nesting)++;
> +       barrier(); /* Keep code within RCU read-side critical section. */
> +}

This looks wrong.

It should use "this_cpu_inc(rcu_read_lock_nesting)", I don't even see
how you get gcc to generate that "inc %fs:" without it.

In general, I don't think you should ever use the __raw_get_cpu_var() things.

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