Skip to content

blk-mq: use percpu_ida to manage tags

Shaohua Li lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyIn review
  2. v14 patches 8 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4percpu_ida: make percpu_ida percpu size/batch configurableinclude/linux/percpu_ida.h lib/percpu_ida.c+28 -180 replies
2/4percpu_ida: add percpu_ida_for_each_freeinclude/linux/percpu_ida.h lib/percpu_ida.c+48 -00 replies
3/4percpu_ida: add an API to return free tagsinclude/linux/percpu_ida.h lib/percpu_ida.c+18 -00 replies
4/4blk-mq: switch to percpu-ida for tag managementblock/blk-mq-tag.c+68 -4020 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [patch 0/4 v2] blk-mq: use percpu_ida to manage tags

Hi,
blk-mq and percpu_ida use similar algorithm to manage tags. The difference is when a cpu can't allocate tags, blk-mq will use ipi to purge remote cpu cache, while percpu-ida directly purges remote cpu cache. In practice, the percpu-ida approach is much faster when we can't allocate enough for percpu cache.

This patch makes blk-mq use percpu_ida to manage tags, this avoids some duplicate code and has better performance as I mentioned. To test the patches, rebase blk-mq tree to latest kernel first.

The v2 patch updated some log descriptions, fixed one issue Kent pointed out and added performance data.

Thanks,
Shaohua