diff options
author | Jens Axboe <axboe@fb.com> | 2014-05-19 11:23:55 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-05-19 13:02:47 -0400 |
commit | 1429d7c9467e1e3de0b0ff91d7e4d67c1a92f8a3 (patch) | |
tree | 3b15abb587392becc4ba37d0869d25a4d9420d1d /include/linux/blk-mq.h | |
parent | e93ecf602beb8439f0bdcc1fa2cbc1f31fdfb8e2 (diff) |
blk-mq: switch ctx pending map to the sparser blk_align_bitmap
Each hardware queue has a bitmap of software queues with pending
requests. When new IO is queued on a software queue, the bit is
set, and when IO is pruned on a hardware queue run, the bit is
cleared. This causes a lot of traffic. Switch this from the regular
BITS_PER_LONG bitmap to a sparser layout, similarly to what was
done for blk-mq tagging.
20% performance increase was observed for single threaded IO, and
about 15% performanc increase on multiple threads driving the
same device.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r-- | include/linux/blk-mq.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index f83d15f6e1c1..952e558ee598 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
@@ -11,6 +11,12 @@ struct blk_mq_cpu_notifier { | |||
11 | void (*notify)(void *data, unsigned long action, unsigned int cpu); | 11 | void (*notify)(void *data, unsigned long action, unsigned int cpu); |
12 | }; | 12 | }; |
13 | 13 | ||
14 | struct blk_mq_ctxmap { | ||
15 | unsigned int map_size; | ||
16 | unsigned int bits_per_word; | ||
17 | struct blk_align_bitmap *map; | ||
18 | }; | ||
19 | |||
14 | struct blk_mq_hw_ctx { | 20 | struct blk_mq_hw_ctx { |
15 | struct { | 21 | struct { |
16 | spinlock_t lock; | 22 | spinlock_t lock; |
@@ -31,8 +37,8 @@ struct blk_mq_hw_ctx { | |||
31 | 37 | ||
32 | void *driver_data; | 38 | void *driver_data; |
33 | 39 | ||
34 | unsigned int nr_ctx_map; | 40 | struct blk_mq_ctxmap ctx_map; |
35 | unsigned long *ctx_map; | 41 | |
36 | unsigned int nr_ctx; | 42 | unsigned int nr_ctx; |
37 | struct blk_mq_ctx **ctxs; | 43 | struct blk_mq_ctx **ctxs; |
38 | 44 | ||