blk-mq: wire up completion notifier for laptop mode
authorJens Axboe <axboe@kernel.dk>
Sat, 30 Sep 2017 08:08:24 +0000 (02:08 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Oct 2017 14:38:17 +0000 (08:38 -0600)
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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <Bart.VanAssche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c

index 59687ed6561b9b2a6c25e2af272305334c763152..7f01d69879d6675af4417d747ac8d83b1486b1af 100644 (file)
@@ -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);