Message ID | 4a2754ad-d76d-482f-9337-5364d46cd38d.zhaowuyun.zwy@alibaba-inc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: peek PM requests during runtime PM | expand |
What tree is this against? Neither elv_next_request nor blk_pm_allow_request exist in upstream, and haven't for a long time.
diff --git a/block/blk-core.c b/block/blk-core.c index a33775cd97be..8b9272bfdc09 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2856,6 +2856,15 @@ static struct request *elv_next_request(struct request_queue *q) if (blk_pm_allow_request(rq)) return rq; + /* + * let the PM request run, + * or the queue may be blocked by the non-PM request + * with RQF_SOFTBARRIER forever while doing runtime PM. + */ + if (q->rpm_status == RPM_SUSPENDING + || q->rpm_status == RPM_RESUMING) + continue; + if (rq->rq_flags & RQF_SOFTBARRIER) break; }