Re: [PATCH v6 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

From: Peter Zijlstra
Date: Wed Sep 16 2015 - 11:07:07 EST


On Tue, Sep 15, 2015 at 11:29:14AM -0400, Waiman Long wrote:

> Only the queue head vCPU will be in pv_wait_head() spinning to acquire the
> lock.

But what will guarantee fwd progress for the lock that is the head?

Suppose CPU0 becomes head and enters the /* claim the lock */ loop.

Then CPU1 comes in, steals it in pv_wait_head(). CPU1 releases, CPU1
re-acquires and _again_ steals in pv_wait_head(), etc..

All the while CPU0 doesn't go anywhere.

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