From: Omar Sandoval <osandov@xxxxxx> Here's v2 of the patch making blk-mq's scalable bitmaps a generic library, now blown up into 5 patches. v1 is here [1]. Changes since v1: - Return -EINVAL instead of BUG_ON() if an invalid shift is passed to the initialization functions. - Rename last_cache to alloc_hint. - Split the wait queue allocation change into a separate patch. Patch 1 should now be a no-op. - Add patches 3 and 4 to make the API cleaner by pushing some context from the blk-mq data structures into the common scale_bitmap code. - Add patch 5 to randomize the allocation hint on initialization like was intended originally for blk-mq. I ran some fio jobs on top of null-blk and verified that there was no performance impact from patches 1-4. Patch 5 is a slight win, although I couldn't come up with a benchmark where the tag allocation is enough of a bottleneck to see huge benefits. My synthetic test module [2], which does the scale_bitmap operations directly, shows much better results. This survived a quick run of xfstests and a battery of benchmarks. Applies to 4.8-rc5. Thanks! 1: http://marc.info/?l=linux-block&m=147251402805405&w=2 2: https://github.com/osandov/osandov-linux/blob/master/modules/scale_bitmap_benchmark/scale_bitmap_benchmark.c Omar Sandoval (5): blk-mq: abstract tag allocation out into scale_bitmap library scale_bitmap: allocate wait queues on a specific node scale_bitmap: push per-cpu last_tag into scale_bitmap_queue scale_bitmap: push alloc policy into scale_bitmap_queue scale_bitmap: randomize initial last_cache values MAINTAINERS | 1 + block/Kconfig | 1 + block/blk-mq-tag.c | 504 ++++++++++--------------------------------- block/blk-mq-tag.h | 42 ++-- block/blk-mq.c | 115 +++------- block/blk-mq.h | 11 - include/linux/blk-mq.h | 9 +- include/linux/scale_bitmap.h | 390 +++++++++++++++++++++++++++++++++ lib/Kconfig | 3 + lib/Makefile | 2 + lib/scale_bitmap.c | 325 ++++++++++++++++++++++++++++ 11 files changed, 887 insertions(+), 516 deletions(-) create mode 100644 include/linux/scale_bitmap.h create mode 100644 lib/scale_bitmap.c -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html