Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1366467

Re: [PATCH v3 2/3] locking/mutex: Enable optimistic spinning of woken task in wait queue

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/3] locking/mutex: Enable optimistic spinning of woken task in wait queue
Date 2016-03-29 18:50 +0200
Message-ID <ri507-wp-29@gated-at.bofh.it> (permalink)
References <rfyBk-82p-5@gated-at.bofh.it> <rfyBk-82p-3@gated-at.bofh.it> <ri442-8nF-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Mar 29, 2016 at 05:39:35PM +0200, Peter Zijlstra wrote:
> On Tue, Mar 22, 2016 at 01:46:43PM -0400, Waiman Long wrote:
> > Ding Tianhong reported a live-lock situation where a constant stream
> > of incoming optimistic spinners blocked a task in the wait list from
> > getting the mutex.
> > 
> > This patch attempts to fix this live-lock condition by enabling the
> > woken task in the wait queue to enter into an optimistic spinning
> > loop itself in parallel with the regular spinners in the OSQ. This
> > should prevent the live-lock condition from happening.
> 
> I would very much like a few words on how fairness is preserved.
> 
> Because while the waiter remains on the wait_list while it spins, and
> therefore unlock()s will only wake it, and we'll only contend with the
> one waiter, the fact that we have two spinners is not fair or starvation
> proof at all.

Alternatively, we can say this is good enough until proven deficient,
but then we should still very much document this.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 2/3] locking/mutex: Enable optimistic spinning of woken task in wait queue Waiman Long <Waiman.Long@hpe.com> - 2016-03-22 18:50 +0100
  Re: [PATCH v3 2/3] locking/mutex: Enable optimistic spinning of  woken task in wait queue Peter Zijlstra <peterz@infradead.org> - 2016-03-29 17:50 +0200
    Re: [PATCH v3 2/3] locking/mutex: Enable optimistic spinning of  woken task in wait queue Peter Zijlstra <peterz@infradead.org> - 2016-03-29 18:50 +0200
      Re: [PATCH v3 2/3] locking/mutex: Enable optimistic spinning of woken  task in wait queue Waiman Long <waiman.long@hpe.com> - 2016-03-31 22:50 +0200
    Re: [PATCH v3 2/3] locking/mutex: Enable optimistic spinning of woken  task in wait queue Waiman Long <waiman.long@hpe.com> - 2016-03-31 23:00 +0200

csiph-web