Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751828AbaACL3Z (ORCPT ); Fri, 3 Jan 2014 06:29:25 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:57878 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751481AbaACL3Q (ORCPT ); Fri, 3 Jan 2014 06:29:16 -0500 From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: Ming Lei Subject: [PATCH] block: blk-mq: fix initializing request's start time Date: Fri, 3 Jan 2014 19:29:04 +0800 Message-Id: <1388748544-14156-1-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1039 Lines: 34 blk_rq_init() is called in req's complete handler to initialize the request, so the members of start_time and start_time_ns might become inaccurate when it is allocated in future. The patch initializes the two members in blk_mq_rq_ctx_init() to fix the problem. Cc: Jens Axboe Signed-off-by: Ming Lei --- block/blk-mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 0974a26..68734f87 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -188,6 +188,8 @@ static void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx, rq->mq_ctx = ctx; rq->cmd_flags = rw_flags; + rq->start_time = jiffies; + set_start_time_ns(rq); ctx->rq_dispatched[rw_is_sync(rw_flags)]++; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/