Skip to content

locking/rwsem: Minor twists to improve rwsem performance

Waiman Long lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 0 repliesNew
  2. v13 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Replace trylock with a more light-weight raw_spin_is_locked() call to reduce overhead.
- Run fio test in addition to rwsem microbenchmark.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3locking/rwsem: Check wait_list without lock if spinner presentkernel/locking/rwsem-xadd.c+11 -50 replies
2/3locking/rwsem: relocate rwsem_down_read_failed()kernel/locking/rwsem-xadd.c+48 -480 replies
3/3locking/rwsem: Stop active read lock ASAPkernel/locking/rwsem-xadd.c+22 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH-tip v2 0/3] locking/rwsem: Minor twists to improve rwsem performance

v1->v2:
- Replace trylock with a more light-weight raw_spin_is_locked() call to reduce overhead.
- Run fio test in addition to rwsem microbenchmark.

This patch set introduces minor changes to the rwsem code path to provide minor performance improvement especially with short critical sections.

Patch 1 checks wait_list without lock when spinners are present.

Patch 2 moves down the rwsem_down_read_failed() function after the optimistic spinning section so that functions in that section can be used.

Patch 3 undoes active read lock ASAP when either the spinners are present or the wait_lock isn't free.

Waiman Long (3):
locking/rwsem: Check wait_list without lock if spinner present locking/rwsem: relocate rwsem_down_read_failed() locking/rwsem: Stop active read lock ASAP

 kernel/locking/rwsem-xadd.c | 129 ++++++++++++++++++++++++++------------------
 1 file changed, 76 insertions(+), 53 deletions(-)
Signature · 1 line
1.8.3.1