Loading block/blk-core.c +6 −2 Original line number Diff line number Diff line Loading @@ -1741,9 +1741,13 @@ EXPORT_SYMBOL_GPL(part_round_stats); #ifdef CONFIG_PM static void blk_pm_put_request(struct request *rq) { if (rq->q->dev && !(rq->rq_flags & RQF_PM) && !--rq->q->nr_pending) if (rq->q->dev && !(rq->rq_flags & RQF_PM) && (rq->rq_flags & RQF_PM_ADDED)) { rq->rq_flags &= ~RQF_PM_ADDED; if (!--rq->q->nr_pending) pm_runtime_mark_last_busy(rq->q->dev); } } #else static inline void blk_pm_put_request(struct request *rq) {} #endif Loading block/elevator.c +11 −4 Original line number Diff line number Diff line Loading @@ -560,16 +560,23 @@ void elv_bio_merged(struct request_queue *q, struct request *rq, #ifdef CONFIG_PM static void blk_pm_requeue_request(struct request *rq) { if (rq->q->dev && !(rq->rq_flags & RQF_PM)) if (rq->q->dev && !(rq->rq_flags & RQF_PM) && (rq->rq_flags & (RQF_PM_ADDED | RQF_FLUSH_SEQ))) { rq->rq_flags &= ~RQF_PM_ADDED; rq->q->nr_pending--; } } static void blk_pm_add_request(struct request_queue *q, struct request *rq) { if (q->dev && !(rq->rq_flags & RQF_PM) && q->nr_pending++ == 0 && (q->rpm_status == RPM_SUSPENDED || q->rpm_status == RPM_SUSPENDING)) if (q->dev && !(rq->rq_flags & RQF_PM)) { rq->rq_flags |= RQF_PM_ADDED; if (q->nr_pending++ == 0 && (q->rpm_status == RPM_SUSPENDED || q->rpm_status == RPM_SUSPENDING)) pm_request_resume(q->dev); } } #else static inline void blk_pm_requeue_request(struct request *rq) {} static inline void blk_pm_add_request(struct request_queue *q, Loading include/linux/blkdev.h +2 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ typedef __u32 __bitwise req_flags_t; #define RQF_MQ_POLL_SLEPT ((__force req_flags_t)(1 << 20)) /* ->timeout has been called, don't expire again */ #define RQF_TIMED_OUT ((__force req_flags_t)(1 << 21)) /* increased nr_pending for this request */ #define RQF_PM_ADDED ((__force req_flags_t)(1 << 22)) /* flags that prevent us from merging requests: */ #define RQF_NOMERGE_FLAGS \ Loading Loading
block/blk-core.c +6 −2 Original line number Diff line number Diff line Loading @@ -1741,9 +1741,13 @@ EXPORT_SYMBOL_GPL(part_round_stats); #ifdef CONFIG_PM static void blk_pm_put_request(struct request *rq) { if (rq->q->dev && !(rq->rq_flags & RQF_PM) && !--rq->q->nr_pending) if (rq->q->dev && !(rq->rq_flags & RQF_PM) && (rq->rq_flags & RQF_PM_ADDED)) { rq->rq_flags &= ~RQF_PM_ADDED; if (!--rq->q->nr_pending) pm_runtime_mark_last_busy(rq->q->dev); } } #else static inline void blk_pm_put_request(struct request *rq) {} #endif Loading
block/elevator.c +11 −4 Original line number Diff line number Diff line Loading @@ -560,16 +560,23 @@ void elv_bio_merged(struct request_queue *q, struct request *rq, #ifdef CONFIG_PM static void blk_pm_requeue_request(struct request *rq) { if (rq->q->dev && !(rq->rq_flags & RQF_PM)) if (rq->q->dev && !(rq->rq_flags & RQF_PM) && (rq->rq_flags & (RQF_PM_ADDED | RQF_FLUSH_SEQ))) { rq->rq_flags &= ~RQF_PM_ADDED; rq->q->nr_pending--; } } static void blk_pm_add_request(struct request_queue *q, struct request *rq) { if (q->dev && !(rq->rq_flags & RQF_PM) && q->nr_pending++ == 0 && (q->rpm_status == RPM_SUSPENDED || q->rpm_status == RPM_SUSPENDING)) if (q->dev && !(rq->rq_flags & RQF_PM)) { rq->rq_flags |= RQF_PM_ADDED; if (q->nr_pending++ == 0 && (q->rpm_status == RPM_SUSPENDED || q->rpm_status == RPM_SUSPENDING)) pm_request_resume(q->dev); } } #else static inline void blk_pm_requeue_request(struct request *rq) {} static inline void blk_pm_add_request(struct request_queue *q, Loading
include/linux/blkdev.h +2 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ typedef __u32 __bitwise req_flags_t; #define RQF_MQ_POLL_SLEPT ((__force req_flags_t)(1 << 20)) /* ->timeout has been called, don't expire again */ #define RQF_TIMED_OUT ((__force req_flags_t)(1 << 21)) /* increased nr_pending for this request */ #define RQF_PM_ADDED ((__force req_flags_t)(1 << 22)) /* flags that prevent us from merging requests: */ #define RQF_NOMERGE_FLAGS \ Loading