Re: [PATCH] rcu: Is it safe to enter an RCU read-side criticalsection?

From: Peter Zijlstra
Date: Mon Sep 09 2013 - 06:56:35 EST


On Fri, Sep 06, 2013 at 10:52:38AM -0700, Paul E. McKenney wrote:
> How about if I made rcu_is_cpu_idle() be as follows?
>
> int rcu_is_cpu_idle(void)
> {
> int ret;
>
> ret = (atomic_read(&per_cpu(rcu_dynticks.dynticks,
> raw_smp_processor_id())) & 0x1) == 0;
> return ret;
> }


No, please use __raw_get_cpu_var(), that generates far better code. Also
any such trickery needs a coherent comment.
--
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/