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


Groups > linux.kernel > #1460043

Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning is enabled

From Jason Low <jason.low2@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning is enabled
Date 2016-08-11 00:10 +0200
Message-ID <s4JRg-2Dd-17@gated-at.bofh.it> (permalink)
References <s4GJI-j6-57@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2016-08-10 at 11:44 -0700, Jason Low wrote:
> Imre reported an issue where threads are getting starved when trying
> to acquire a mutex. Threads acquiring a mutex can get arbitrarily delayed
> sleeping on a mutex because other threads can continually steal the lock
> in the fastpath and/or through optimistic spinning.
> 
> Waiman has developed patches that allow waiters to return to optimistic
> spinning, thus reducing the probability that starvation occurs. However,
> Imre still sees this starvation problem in the workloads when optimistic
> spinning is disabled.
> 
> This patch adds an additional boolean to the mutex that gets used in
> the CONFIG_SMP && !CONFIG_MUTEX_SPIN_ON_OWNER cases. The flag signifies
> whether or not other threads need to yield to a waiter and gets set
> when a waiter spends too much time waiting for the mutex. The threshold
> is currently set to 16 wakeups, and once the wakeup threshold is exceeded,
> other threads must yield to the top waiter. The flag gets cleared
> immediately after the top waiter acquires the mutex.

Just noticed that the patch title mentions "when spinning is enabled".

The title should really be:

"locking/mutex: Prevent lock starvation when spinning is disabled"

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


Thread

[PATCH v2] locking/mutex: Prevent lock starvation when spinning is  enabled Jason Low <jason.low2@hpe.com> - 2016-08-10 20:50 +0200
  Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Jason Low <jason.low2@hpe.com> - 2016-08-11 00:10 +0200
  Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Jason Low <jason.low2@hpe.com> - 2016-08-11 04:40 +0200
  Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Jason Low <jason.low2@hpe.com> - 2016-08-16 21:50 +0200
  Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Wanpeng Li <kernellwp@gmail.com> - 2016-08-17 03:50 +0200
    Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Jason Low <jason.low2@hpe.com> - 2016-08-17 20:40 +0200
      Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Wanpeng Li <kernellwp@gmail.com> - 2016-08-18 02:40 +0200
  Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Peter Zijlstra <peterz@infradead.org> - 2016-08-18 16:30 +0200
    Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Peter Zijlstra <peterz@infradead.org> - 2016-08-19 02:50 +0200
      Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Peter Zijlstra <peterz@infradead.org> - 2016-08-19 02:50 +0200
  Re: [PATCH v2] locking/mutex: Prevent lock starvation when spinning  is enabled Peter Zijlstra <peterz@infradead.org> - 2016-08-18 16:50 +0200

csiph-web