[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH V6 0/2] percpu_ref & block: reduce memory footprint of percpu_ref in fast path

The 1st patch removes memory footprint of percpu_ref in fast path
from 7 words to 2 words, since it is often used in fast path and
embedded in user struct.

The 2nd patch moves .q_usage_counter to 1st cacheline of

Simple test on null_blk shows ~2% IOPS boost on one 16cores(two threads
per core) machine, dual socket/numa.

- drop the 1st patch which adds percpu_ref_is_initialized() for MD
only, since Christoph doesn't like it

- fix memory leak on ref->data, only percpu_ref_exit() of patch 2
is modified.

- rename percpu_ref_inited as percpu_ref_is_initialized

- fix kernel oops on MD
- add patch for avoiding to use percpu-refcount internal from md
- pass Red Hat CKI test which is done by Veronika Kabatova

- pass 'gfp' to kzalloc() for fixing block/027 failure reported by
kernel test robot
- protect percpu_ref_is_zero() with destroying percpu-refcount by
spin lock

Ming Lei (2):
percpu_ref: reduce memory footprint of percpu_ref in fast path
block: move 'q_usage_counter' into front of 'request_queue'

drivers/infiniband/sw/rdmavt/mr.c | 2 +-
include/linux/blkdev.h | 3 +-
include/linux/percpu-refcount.h | 45 ++++------
lib/percpu-refcount.c | 131 ++++++++++++++++++++++--------
4 files changed, 118 insertions(+), 63 deletions(-)

Cc: Veronika Kabatova <>
Cc: Sagi Grimberg <>
Cc: Tejun Heo <>
Cc: Christoph Hellwig <>
Cc: Jens Axboe <>
Cc: Bart Van Assche <>

 \ /
  Last update: 2020-09-30 10:28    [W:0.043 / U:3.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site