Re: [PATCH 1/1] x86, ticketlock: spin_unlock_wait() can livelock

From: Linus Torvalds
Date: Mon Dec 01 2014 - 16:49:40 EST


On Mon, Dec 1, 2014 at 1:34 PM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> But we do not need to wait for arch_spin_is_locked() == F. If it is
> locked we only need to wait until the current owner drops this lock.
> So we could simply spin until old_head != lock->tickets.head in this
> case, but .head can overflow and thus we can't check "unlocked" only
> once before the main loop.

Ack. Looks like a good idea. Can you point to the report that you
think this might be the cause of?

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