On Tue, Nov 23, 2021 at 09:18:13AM -0700, Jens Axboe wrote: > This is essentially never used, yet it's about 1/3rd of the total > queue size. Allocate it when needed, and don't embed it in the queue. > > Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> > --- > block/blk-mq.c | 20 ++++++++++++++++++-- > block/blk-stat.c | 6 ------ > block/blk-sysfs.c | 1 + > include/linux/blkdev.h | 9 +++++++-- > 4 files changed, 26 insertions(+), 10 deletions(-) > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 20a6445f6a01..cb41c441aa8f 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -4577,9 +4577,25 @@ EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues); > /* Enable polling stats and return whether they were already enabled. */ > static bool blk_poll_stats_enable(struct request_queue *q) > { > - if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags) || > - blk_queue_flag_test_and_set(QUEUE_FLAG_POLL_STATS, q)) > + struct blk_rq_stat *poll_stat; > + > + if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags)) > return true; Can't we replace the checks for QUEUE_FLAG_POLL_STATS with checks for q->poll_stat now?