Re: Q: locking mechanisms

From: Thomas Gleixner
Date: Sat Jul 01 2006 - 05:32:22 EST


Urs,

On Sat, 2006-07-01 at 07:58 +0200, Urs Thuermann wrote:
> So my question is, is it really necessary for the list traversal to be
> atomic, i.e. to disable preemption? According to "Linux Device
> Drivers", this is needed for the callback function, so it can be
> called after the scheduler has been run on all CPUs and no reader is
> still accessing the list item to be freed. Is it right, that the
> rcu_read_lock() wouldn't be necessary if I only would call
> list_add_rcu() and list_del_rcu() since these make atomic changes and
> can run in parallel anyway, even with rcu_read_lock(), on a SMP
> system?

Does Documentation/listRCU.txt answer your questions ?

tglx


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