diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-11-14 00:03:26 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-11-29 16:38:35 +0300 |
commit | 48b5c1fbcd8c5bc6b91a56399a5257b801391dd8 (patch) | |
tree | ca7326ec1b162e4e8cc3701ea620b6b13012798b /block/blk-sysfs.c | |
parent | 25c4b5e058578066db56d757ad3a7adeaff35856 (diff) | |
download | linux-48b5c1fbcd8c5bc6b91a56399a5257b801391dd8.tar.xz |
block: only allocate poll_stats if there's a user of them
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.
Kill the queue flag for this while at it, since we can just check the
assigned pointer now.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r-- | block/blk-sysfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index cd75b0f73dc6..c079be1c58a3 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -785,11 +785,12 @@ static void blk_release_queue(struct kobject *kobj) might_sleep(); - if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags)) + if (q->poll_stat) blk_stat_remove_callback(q, q->poll_cb); blk_stat_free_callback(q->poll_cb); blk_free_queue_stats(q->stats); + kfree(q->poll_stat); blk_exit_queue(q); |