Skip to content

Commit 0d81986

Browse files
committed
Merge: blk-mq: don't count completed flush data request as inflight in case of quiesce
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3451 JIRA: https://issues.redhat.com/browse/RHEL-18054 Signed-off-by: Ming Lei <[email protected]> Approved-by: Jeff Moyer <[email protected]> Approved-by: John Meneghini <[email protected]> Signed-off-by: Scott Weaver <[email protected]>
2 parents 13a3e1e + 8c85538 commit 0d81986

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

block/blk-mq.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,14 +1514,26 @@ void blk_mq_delay_kick_requeue_list(struct request_queue *q,
15141514
}
15151515
EXPORT_SYMBOL(blk_mq_delay_kick_requeue_list);
15161516

1517+
static bool blk_is_flush_data_rq(struct request *rq)
1518+
{
1519+
return (rq->rq_flags & RQF_FLUSH_SEQ) && !is_flush_rq(rq);
1520+
}
1521+
15171522
static bool blk_mq_rq_inflight(struct request *rq, void *priv)
15181523
{
15191524
/*
15201525
* If we find a request that isn't idle we know the queue is busy
15211526
* as it's checked in the iter.
15221527
* Return false to stop the iteration.
1528+
*
1529+
* In case of queue quiesce, if one flush data request is completed,
1530+
* don't count it as inflight given the flush sequence is suspended,
1531+
* and the original flush data request is invisible to driver, just
1532+
* like other pending requests because of quiesce
15231533
*/
1524-
if (blk_mq_request_started(rq)) {
1534+
if (blk_mq_request_started(rq) && !(blk_queue_quiesced(rq->q) &&
1535+
blk_is_flush_data_rq(rq) &&
1536+
blk_mq_request_completed(rq))) {
15251537
bool *busy = priv;
15261538

15271539
*busy = true;

0 commit comments

Comments
 (0)