From: Omar Sandoval <osandov@xxxxxx>...
This is a generally useful data structure, so make it available to
anyone else who might want to use it. It's also a nice cleanup
separating the allocation logic from the rest of the tag handling logic.
The code is behind a new Kconfig option, CONFIG_SCALE_BITMAP, which is
only selected by CONFIG_BLOCK for now.
This should be a complete noop functionality-wise.
Signed-off-by: Omar Sandoval <osandov@xxxxxx>
---
MAINTAINERS | 1 +
block/Kconfig | 1 +
block/blk-mq-tag.c | 469 ++++++++++---------------------------------
block/blk-mq-tag.h | 37 +---
block/blk-mq.c | 113 +++--------
block/blk-mq.h | 9 -
include/linux/blk-mq.h | 9 +-
include/linux/scale_bitmap.h | 340 +++++++++++++++++++++++++++++++
lib/Kconfig | 3 +
lib/Makefile | 2 +
lib/scale_bitmap.c | 305 ++++++++++++++++++++++++++++
diff --git a/include/linux/scale_bitmap.h b/include/linux/scale_bitmap.h...
new file mode 100644
index 0000000..63f712b
--- /dev/null
+++ b/include/linux/scale_bitmap.h
@@ -0,0 +1,340 @@
+/*
+ * Fast and scalable bitmaps.
+/**
+ * struct scale_bitmap_word - Word in a &struct scale_bitmap.
+ */
+struct scale_bitmap_word {
+/**
+ * struct scale_bitmap - Scalable bitmap.
+ *
+ * A &struct scale_bitmap is spread over multiple cachelines to avoid ping-pong.
+ * This trades off higher memory usage for better scalability.
+ */
+struct scale_bitmap {