summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorChengming Zhou <zhouchengming@bytedance.com>2023-04-13 14:28:05 +0800
committerJens Axboe <axboe@kernel.dk>2023-04-13 06:48:11 -0600
commit8e15dfbd9ae21e518979e3823e335073e725f445 (patch)
treec52de30f05381d2c5e2c361ce597a91a1ef43867 /block
parent20de765f6d9da0c47b756429c60b41063b990a10 (diff)
blk-throttle: only enable blk-stat when BLK_DEV_THROTTLING_LOW
blk_throtl_register() will unconditionally enable blk-stat for gendisk when register, even when we have no BLK_DEV_THROTTLING_LOW config. Since the kernel always has only BLK_DEV_THROTTLING config and the BLK_DEV_THROTTLING_LOW config is still in EXPERIMENTAL state, we can just skip blk-stat when !BLK_DEV_THROTTLING_LOW. Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20230413062805.2081970-2-chengming.zhou@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-throttle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 9bac95343ba0..9d010d867fbf 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -2443,11 +2443,12 @@ void blk_throtl_register(struct gendisk *disk)
#ifndef CONFIG_BLK_DEV_THROTTLING_LOW
/* if no low limit, use previous default */
td->throtl_slice = DFL_THROTL_SLICE_HD;
-#endif
+#else
td->track_bio_latency = !queue_is_mq(q);
if (!td->track_bio_latency)
blk_stat_enable_accounting(q);
+#endif
}
#ifdef CONFIG_BLK_DEV_THROTTLING_LOW