Skip to content

Commit 71b8642

Browse files
YuKuai-huaweiaxboe
authored andcommitted
blk-wbt: remove dead code to handle wbt enable/disable with io inflight
enable or disable wbt is always called with queue freezed, so that wbt can never be enabled or disabled while io is still inflight, and this behaviour should always hold to avoid io hang(There have been reported several times). Therefor, the code to handle wbt enable/diskble with io inflight is not and never will be used, hence remove such dead code. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230527010644.647900-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 645a829 commit 71b8642

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

block/blk-wbt.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,6 @@ static void wbt_rqw_done(struct rq_wb *rwb, struct rq_wait *rqw,
200200

201201
inflight = atomic_dec_return(&rqw->inflight);
202202

203-
/*
204-
* wbt got disabled with IO in flight. Wake up any potential
205-
* waiters, we don't have to do more than that.
206-
*/
207-
if (unlikely(!rwb_enabled(rwb))) {
208-
rwb_wake_all(rwb);
209-
return;
210-
}
211-
212203
/*
213204
* For discards, our limit is always the background. For writes, if
214205
* the device does write back caching, drop further down before we
@@ -545,13 +536,6 @@ static inline unsigned int get_limit(struct rq_wb *rwb, blk_opf_t opf)
545536
{
546537
unsigned int limit;
547538

548-
/*
549-
* If we got disabled, just return UINT_MAX. This ensures that
550-
* we'll properly inc a new IO, and dec+wakeup at the end.
551-
*/
552-
if (!rwb_enabled(rwb))
553-
return UINT_MAX;
554-
555539
if ((opf & REQ_OP_MASK) == REQ_OP_DISCARD)
556540
return rwb->wb_background;
557541

0 commit comments

Comments
 (0)