Re: [PATCH] Convert preempt_disabled in module.c to rcu read lock

From: Rusty Russell
Date: Thu Sep 23 2010 - 00:35:25 EST


On Wed, 22 Sep 2010 10:37:20 pm Andi Kleen wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> Thomas Gleixner pointed out that the list_for_each_rcu()
> in module really need to use RCU read lock, not preempt disable.
> This is especially needed for the preemptive RCU code.
> >From what I understand the only reason for the preemption
> disabling is to protect against rcu, so using rcu_read_lock()
> is correct.

The preempt_disable() also protects against stop_machine() on
module remove.

I haven't been following the RCU story, but we were always slightly
abusing the infrastructure here just to do lockless insert. If
list_for_each_entry_rcu() is changing, perhaps we need to open-code
the old version here?

Rusty.
--
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/