diff mbox

blk-mq: wire up completion notifier for laptop mode

Message ID 05155e41-caab-0ff4-8520-5eff59c9cf7a@kernel.dk (mailing list archive)
State New, archived
Headers show

Commit Message

Jens Axboe Sept. 30, 2017, 8:06 a.m. UTC
For some reason, the laptop mode IO completion notified was never wired
up for blk-mq. Ensure that we trigger the callback appropriately, to arm
the laptop mode flush timer.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

Comments

Christoph Hellwig Oct. 1, 2017, 8:37 a.m. UTC | #1
On Sat, Sep 30, 2017 at 10:06:45AM +0200, Jens Axboe wrote:
> For some reason, the laptop mode IO completion notified was never wired
> up for blk-mq. Ensure that we trigger the callback appropriately, to arm
> the laptop mode flush timer.

Looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Bart Van Assche Oct. 2, 2017, 3:44 p.m. UTC | #2
On Sat, 2017-09-30 at 10:06 +0200, Jens Axboe wrote:
> For some reason, the laptop mode IO completion notified was never wired

> up for blk-mq. Ensure that we trigger the callback appropriately, to arm

> the laptop mode flush timer.


Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
diff mbox

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 98a18609755e..09e92667be98 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -476,6 +476,9 @@  void blk_mq_free_request(struct request *rq)
 	if (rq->rq_flags & RQF_MQ_INFLIGHT)
 		atomic_dec(&hctx->nr_active);
 
+	if (unlikely(laptop_mode && !blk_rq_is_passthrough(rq)))
+		laptop_io_completion(q->backing_dev_info);
+
 	wbt_done(q->rq_wb, &rq->issue_stat);
 
 	clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags);