Re: [PATCH RFC ticketlock] Auto-queued ticketlock

From: Linus Torvalds
Date: Wed Jun 12 2013 - 16:37:24 EST

On Wed, Jun 12, 2013 at 1:03 PM, Davidlohr Bueso <davidlohr.bueso@xxxxxx> wrote:
> Waiman's dcache patchet were actually an attempt to address these exact
> issues:

Ok, looking at that patch-set, I think it has the same race with not
atomically getting the d_lock spinlock and d_count going down to zero
in dput(). And Waiman clearly didn't know about
"atomic_inc_not_zero()" or "atomic_dec_and_lock()" that are designed
for exactly the "increment if already nonzero" and "decrement without
taking the lock if we're not going down to zero" cases.

As outlined, I'm also not at all sure that the whole seqrw-lock thing
that Waiman did is really necessary - I think the optimistic
dget_parent() might be sufficient.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at