Skip to content

percpu_ref & block: reduce memory footprint of percpu_ref in fast path

Ming Lei linux-block lkml 7 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest2 patches 3 repliesApplied
  2. v62 patches 2 repliesSuperseded
  3. v53 patches 1 replySuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v43 patches0 repliesSuperseded
v33 patches3 repliesSuperseded
v22 patches3 repliesApplied
v12 patches0 repliesSuperseded

Changes in v7 from the cover letter

- add comments about reason for struct split

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/2percpu_ref: reduce memory footprint of percpu_ref in fast pathdrivers/infiniband/sw/rdmavt/mr.c include/linux/percpu-refcount.h lib/percpu-refcount.c+123 -621 reply
2/2block: move 'q_usage_counter' into front of 'request_queue'include/linux/blkdev.h+2 -10 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchVeronika KabatovaChristoph HellwigTejun Heo
1/2T-b R-b A-b
2/2T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v7 thread

Cover letter [PATCH V7 0/2] percpu_ref & block: reduce memory footprint of percpu_ref in fast path

Hi,

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 'request_queue'.

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

V7:
- add comments about reason for struct split

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

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

V4:
- rename percpu_ref_inited as percpu_ref_is_initialized

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

V2:
- 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   |  52 ++++++------
 lib/percpu-refcount.c             | 131 ++++++++++++++++++++++--------
 4 files changed, 125 insertions(+), 63 deletions(-)
Cc Veronika Kabatova <[email protected]>
Cc Sagi Grimberg <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Jens Axboe <[email protected]>
Cc Bart Van Assche <[email protected]>
Signature · 1 line
2.25.2