[PATCH V4 3/3] block: move 'q_usage_counter' into front of 'request_queue'

From: Ming Lei
Date: Wed Sep 09 2020 - 03:18:54 EST

The field of 'q_usage_counter' is always fetched in fast path of every
block driver, and move it into front of 'request_queue', so it can be
fetched into 1st cacheline of 'request_queue' instance.

Tested-by: Veronika Kabatova <vkabatov@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Cc: Sagi Grimberg <sagi@xxxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxx>
Cc: Bart Van Assche <bvanassche@xxxxxxx>
Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
include/linux/blkdev.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 7d82959e7b86..7b1e53084799 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -397,6 +397,8 @@ struct request_queue {
struct request *last_merge;
struct elevator_queue *elevator;

+ struct percpu_ref q_usage_counter;
struct blk_queue_stats *stats;
struct rq_qos *rq_qos;

@@ -569,7 +571,6 @@ struct request_queue {
* percpu_ref_kill() and percpu_ref_reinit().
struct mutex mq_freeze_lock;
- struct percpu_ref q_usage_counter;

struct blk_mq_tag_set *tag_set;
struct list_head tag_set_list;