On Tue, 2008-07-29 at 10:47 +0900, Tejun Heo wrote:
But the fact is that PREEMPT_RCU is upstream now..
Nope, we'd want something like:
cpu = get_cpu();
data = percpu_ptr(ptr, cpu);
This clearly shows the intent - on -rt we can then easily convert the
per-cpu stuff to use a lock instead of disabling preemption. Making the
whole code sequence preemptible.
If you would have mixed it into the rcu ops, its unclear what code needs
protection from what.
preempt_disable() is just like the BKL, its opaque in that it isn't
bound to some data and doesn't tell you what it protects. So getting rid
of them afterwards is pain.
Therefore we prefer APIs such as, get_cpu() etc.. that show intent and
don;t like stuff you just now proposed of mixing intents. Because when
changing the preemption model you might need different solution for