mbox series

[v2,0/2] optimise blk_try_enter_queue()

Message ID cover.1634822969.git.asml.silence@gmail.com (mailing list archive)
Headers show
Series optimise blk_try_enter_queue() | expand

Message

Pavel Begunkov Oct. 21, 2021, 1:30 p.m. UTC
Kill extra rcu_read_lock/unlock() pair in blk_try_enter_queue().
Testing with io_uring (high batching) with nullblk:

Before:
3.20%  io_uring  [kernel.vmlinux]  [k] __rcu_read_unlock
3.05%  io_uring  [kernel.vmlinux]  [k] __rcu_read_lock

After:
2.52%  io_uring  [kernel.vmlinux]  [k] __rcu_read_unlock
2.28%  io_uring  [kernel.vmlinux]  [k] __rcu_read_lock

Doesn't necessarily translates into 1.4% perfofrmance improvement
but nice to have.

v2: rcu_read_lock_held() warning (Tejun)

Pavel Begunkov (2):
  percpu_ref: percpu_ref_tryget_live() version holding RCU
  block: kill extra rcu lock/unlock in queue enter

 block/blk-core.c                |  2 +-
 include/linux/percpu-refcount.h | 33 +++++++++++++++++++++++----------
 2 files changed, 24 insertions(+), 11 deletions(-)

Comments

Jens Axboe Oct. 21, 2021, 2:37 p.m. UTC | #1
On Thu, 21 Oct 2021 14:30:50 +0100, Pavel Begunkov wrote:
> Kill extra rcu_read_lock/unlock() pair in blk_try_enter_queue().
> Testing with io_uring (high batching) with nullblk:
> 
> Before:
> 3.20%  io_uring  [kernel.vmlinux]  [k] __rcu_read_unlock
> 3.05%  io_uring  [kernel.vmlinux]  [k] __rcu_read_lock
> 
> [...]

Applied, thanks!

[1/2] percpu_ref: percpu_ref_tryget_live() version holding RCU
      commit: 3b13c168186c115501ee7d194460ba2f8c825155
[2/2] block: kill extra rcu lock/unlock in queue enter
      commit: e94f68527a35271131cdf9d3fb4eb3c2513dc3d0

Best regards,