Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

blk-wbt: Optimize wbt_done() for non-throttled writes

In the current implementation, the sync_cookie and last_cookie members of
struct rq_wb are used only by read requests and not by non-throttled write
requests. Based on this, we can optimize wbt_done() by removing one if
condition check for non-throttled write requests.

Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20250727173959.160835-2-yizhou.tang@shopee.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Tang Yizhou and committed by
Jens Axboe
d8b96a79 343dc542

+6 -5
+6 -5
block/blk-wbt.c
··· 248 248 struct rq_wb *rwb = RQWB(rqos); 249 249 250 250 if (!wbt_is_tracked(rq)) { 251 - if (rwb->sync_cookie == rq) { 252 - rwb->sync_issue = 0; 253 - rwb->sync_cookie = NULL; 254 - } 251 + if (wbt_is_read(rq)) { 252 + if (rwb->sync_cookie == rq) { 253 + rwb->sync_issue = 0; 254 + rwb->sync_cookie = NULL; 255 + } 255 256 256 - if (wbt_is_read(rq)) 257 257 wb_timestamp(rwb, &rwb->last_comp); 258 + } 258 259 } else { 259 260 WARN_ON_ONCE(rq == rwb->sync_cookie); 260 261 __wbt_done(rqos, wbt_flags(rq));