From: Davidlohr Bueso <dave@stgolabs.net>
To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Jason Low <jason.low2@hp.com>,
Michel Lespinasse <walken@google.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>
Subject: [PATCH -tip v2 0/5] rwsem: Fine tuning
Date: Fri, 30 Jan 2015 01:14:22 -0800 [thread overview]
Message-ID: <1422609267-15102-1-git-send-email-dave@stgolabs.net> (raw)
Hello,
First two patches are self descriptive obvious add-ons.
The rest are performance enhancements for write-mostly workloads.
While this is not our priority (use mutexes instead!!), there are
cases where heavy use of writers can severely hurt rwsem performance.
For instance, we got reports[1] of writer only issues when converting
the i_mmap_rwsem from mutex, on a workload that pathologically pounds
on this lock for vma operations:
- 81.20% execl [kernel.kallsyms] [k] osq_lock
- 100.00% mutex_optimistic_spin
__mutex_lock_slowpath
- mutex_lock
+ 47.71% unlink_file_vma
+ 34.91% vma_adjust
+ 17.38% vma_link
This is enough to make small differences painfully evident. These changes
(particularly patch 5/5) recover most (~75%) of the performance regression.
Patches 3- 5 deal with optimistic spinning fine tuning. Details are in the
individual patches. Passes multiple x86-64 tests.
Thanks!
Changes since v1 (https://lkml.org/lkml/2015/1/26/34):
- Redid patch 2.
- Improved "Check for active lock before bailing on spinning" patch
to consider checking if the lock has a new owner.
- Dropped patch 5, will send a new patch later disabling preemption in the
slowpath to get rid of the barriers (assuming testing goes well) without
missing wakeups. It's not very related to the patches in this series anyway.
Davidlohr Bueso (5):
locking/rwsem: Use task->state helpers
locking/rwsem: Document barrier need when waking tasks
locking/rwsem: Set lock ownership ASAP
locking/rwsem: Avoid deceiving lock spinners
locking/rwsem: Check for active lock before bailing on spinning
kernel/locking/mutex.c | 2 +-
kernel/locking/rwsem-spinlock.c | 9 +++++-
kernel/locking/rwsem-xadd.c | 66 ++++++++++++++++++++++++++++-------------
kernel/locking/rwsem.c | 22 +-------------
kernel/locking/rwsem.h | 20 +++++++++++++
5 files changed, 76 insertions(+), 43 deletions(-)
create mode 100644 kernel/locking/rwsem.h
--
2.1.4
next reply other threads:[~2015-01-30 9:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-30 9:14 Davidlohr Bueso [this message]
2015-01-30 9:14 ` [PATCH 1/5] locking/rwsem: Use task->state helpers Davidlohr Bueso
2015-01-30 9:14 ` [PATCH 2/5] locking/rwsem: Document barrier need when waking tasks Davidlohr Bueso
2015-02-18 17:11 ` [tip:locking/core] " tip-bot for Davidlohr Bueso
2015-01-30 9:14 ` [PATCH 3/5] locking/rwsem: Set lock ownership ASAP Davidlohr Bueso
2015-02-18 17:11 ` [tip:locking/core] " tip-bot for Davidlohr Bueso
2015-01-30 9:14 ` [PATCH 4/5] locking/rwsem: Avoid deceiving lock spinners Davidlohr Bueso
2015-01-31 1:51 ` Tim Chen
2015-01-31 2:28 ` Davidlohr Bueso
2015-02-03 17:16 ` Tim Chen
2015-02-03 17:54 ` Jason Low
2015-02-03 19:43 ` Tim Chen
2015-02-03 21:04 ` Jason Low
2015-02-03 21:48 ` Tim Chen
2015-02-04 12:06 ` Peter Zijlstra
2015-02-04 17:39 ` Tim Chen
2015-01-31 9:29 ` Peter Zijlstra
2015-01-31 21:14 ` Davidlohr Bueso
2015-01-31 21:17 ` Davidlohr Bueso
2015-02-18 17:12 ` [tip:locking/core] " tip-bot for Davidlohr Bueso
2015-01-30 9:14 ` [PATCH 5/5] locking/rwsem: Check for active lock before bailing on spinning Davidlohr Bueso
2015-02-18 17:12 ` [tip:locking/core] " tip-bot for Davidlohr Bueso
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=1422609267-15102-1-git-send-email-dave@stgolabs.net \
--to=dave@stgolabs.net \
--cc=jason.low2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tim.c.chen@linux.intel.com \
--cc=walken@google.com \
/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®