From: Jens Axboe Date: Tue, 24 Nov 2015 22:58:53 +0000 (-0700) Subject: block: clarify blk_add_timer() use case for blk-mq X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3b627a3f934c493ada71217f14681e5157e95783;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git block: clarify blk_add_timer() use case for blk-mq Just a comment update on not needing queue_lock, and that we aren't really adding the request to a timeout list for !mq. Signed-off-by: Jens Axboe --- diff --git a/block/blk-timeout.c b/block/blk-timeout.c index aa40aa93381b..3610af561748 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -186,6 +186,7 @@ unsigned long blk_rq_timeout(unsigned long timeout) * Notes: * Each request has its own timer, and as it is added to the queue, we * set up the timer. When the request completes, we cancel the timer. + * Queue lock must be held for the non-mq case, mq case doesn't care. */ void blk_add_timer(struct request *req) { @@ -209,6 +210,11 @@ void blk_add_timer(struct request *req) req->timeout = q->rq_timeout; req->deadline = jiffies + req->timeout; + + /* + * Only the non-mq case needs to add the request to a protected list. + * For the mq case we simply scan the tag map. + */ if (!q->mq_ops) list_add_tail(&req->timeout_list, &req->q->timeout_list);