On 5/15/25 7:47 AM, Zizhi Wo wrote: > > > 在 2025/5/15 21:39, Jens Axboe 写道: >> On 5/15/25 7:08 AM, Aishwarya wrote: >>> Observed the following build warning when building the next-20250515 kernel with defconfig+CONFIG_BLK_DEV_THROTTLING applied: >>> >>> Warning output: >>> >>> ../block/blk-throttle.c: In function 'throtl_pending_timer_fn': >>> ../block/blk-throttle.c:1153:30: warning: unused variable 'bio_cnt_w' [-Wunused-variable] >>> 1153 | unsigned int bio_cnt_w = sq_queued(sq, WRITE); >>> | ^~~~~~~~~ >>> ../block/blk-throttle.c:1152:30: warning: unused variable 'bio_cnt_r' [-Wunused-variable] >>> 1152 | unsigned int bio_cnt_r = sq_queued(sq, READ); >>> | ^~~~~~~~~ >>> >>> >>> There?s no warning with defconfig alone, and I?ve confirmed that the warning appears when CONFIG_BLK_DEV_THROTTLING is explicitly enabled. >> >> This should fix it. The issue is if blktrace isn't enabled. >> >> diff --git a/block/blk-throttle.c b/block/blk-throttle.c >> index bf4faac83662..bd15357f23bd 100644 >> --- a/block/blk-throttle.c >> +++ b/block/blk-throttle.c >> @@ -1149,8 +1149,8 @@ static void throtl_pending_timer_fn(struct timer_list *t) >> dispatched = false; >> while (true) { >> - unsigned int bio_cnt_r = sq_queued(sq, READ); >> - unsigned int bio_cnt_w = sq_queued(sq, WRITE); >> + unsigned int __maybe_unused bio_cnt_r = sq_queued(sq, READ); >> + unsigned int __maybe_unused bio_cnt_w = sq_queued(sq, WRITE); >> throtl_log(sq, "dispatch nr_queued=%u read=%u write=%u", >> bio_cnt_r + bio_cnt_w, bio_cnt_r, bio_cnt_w); >> > > Oops.. I didn't take that into account. Those two variables are only > used in throtl_log. I'll check if there are any other similar issues and > send out a fix patch shortly. Thanks for pointing it out! Easy to miss, as it needs throttle enabled and blktrace not enabled. I did test compile the above, and I didn't spot any other ones. -- Jens Axboe