Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Thu Oct 11 2001 - 22:27:33 EST


On Wed, 10 Oct 2001 03:18:23 -0700 (PDT)
Linus Torvalds <torvalds@transmeta.com> wrote:

> lock
> unhash
> unlock
> if (atomic_dec()) {
> free
> }

And the read side is:
        lock
        loopup
        atomic_inc
        unlock

With RCU, read side is:
        loopup
        atomic_inc

Write is:
        lock /* protect against other writes */
        unhash /* be careful with wmb()s here... */
        unlock
        call_rcu(if (atomic_dec()) free) /* ie. does this later */

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



This archive was generated by hypermail 2b29 : Mon Oct 15 2001 - 21:00:43 EST