From: Waiman Long <Waiman.Long@hpe.com>
To: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Ding Tianhong <dingtianhong@huawei.com>,
Jason Low <jason.low2@hpe.com>,
Davidlohr Bueso <dave@stgolabs.net>,
"Paul E. McKenney" <paulmck@us.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Will Deacon <Will.Deacon@arm.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Waiman Long <Waiman.Long@hpe.com>
Subject: [PATCH 0/2] locking/mutex: Enable optimistic spinning of lock waiter
Date: Tue, 9 Feb 2016 14:47:40 -0500 [thread overview]
Message-ID: <1455047262-27731-1-git-send-email-Waiman.Long@hpe.com> (raw)
This patchset is a variant of PeterZ's "locking/mutex: Avoid spinner
vs waiter starvation" patch. The major difference is that the
waiter-spinner won't enter into the OSQ used by the spinners. Instead,
it will spin directly on the lock in parallel with the queue head
of the OSQ. So there will be a bit more cacheline contention on the
lock cacheline, but that shouldn't cause noticeable impact on system
performance.
This patchset tries to address 2 issues with Peter's patch:
1) Ding Tianhong still find that hanging task could happen in some cases.
2) Jason Low found that there was performance regression for some AIM7
workloads.
By making the waiter-spinner to spin directly on the mutex, it will
increase the chance for the waiter-spinner to get the lock instead
of waiting in the OSQ for its turn.
My own test on a 4-socket E7-4820 v3 system showed a regression of
about 4% in the high_systime workload with Peter's patch which this
new patch effectively eliminates.
Waiman Long (2):
locking/mutex: Add waiter parameter to mutex_optimistic_spin()
locking/mutex: Enable optimistic spinning of woken task in wait queue
kernel/locking/mutex.c | 68 ++++++++++++++++++++++++++++++++++-------------
1 files changed, 49 insertions(+), 19 deletions(-)
next reply other threads:[~2016-02-09 19:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-09 19:47 Waiman Long [this message]
2016-02-09 19:47 ` [PATCH 1/2] locking/mutex: Add waiter parameter to mutex_optimistic_spin() Waiman Long
2016-02-09 19:47 ` [PATCH 2/2] locking/mutex: Enable optimistic spinning of woken task in wait queue Waiman Long
2016-02-09 21:44 ` [PATCH 0/2] locking/mutex: Enable optimistic spinning of lock waiter Jason Low
2016-02-12 17:22 ` Waiman Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455047262-27731-1-git-send-email-Waiman.Long@hpe.com \
--to=waiman.long@hpe.com \
--cc=Will.Deacon@arm.com \
--cc=dave@stgolabs.net \
--cc=dingtianhong@huawei.com \
--cc=jason.low2@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@us.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®