From patchwork Wed May 2 17:34:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10376133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0D71603B4 for ; Wed, 2 May 2018 17:34:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3AC028E21 for ; Wed, 2 May 2018 17:34:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D888928F21; Wed, 2 May 2018 17:34:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89D8E28F31 for ; Wed, 2 May 2018 17:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751178AbeEBRes (ORCPT ); Wed, 2 May 2018 13:34:48 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43684 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942AbeEBRer (ORCPT ); Wed, 2 May 2018 13:34:47 -0400 Received: by mail-pf0-f193.google.com with SMTP id j11so12367213pff.10 for ; Wed, 02 May 2018 10:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=YtaPFkPRoWxBLYEwMWpUUFTWSWcEQ2h0j7gL6pS1rho=; b=aO8TqWkN0E/uCoOpx0VSLPYnC+aZr49qErNbVRUIXiKFEcU73+GWssPnaIHpRy0NXo 7j/NlwRbXykcn/0E79wokZrjnyOb86cEHNnpYGRAyn6RyZnCMm3/ZY0vWMub1u2TNgZe UD3EigurKQUow23NB5BCx/r4Vx02JdQzXJ+AMlnPLBWtm9iHorUHfNF5M8M8cS4SvQuf AqQh4u3QpWbl66jLt8ZYvVYyo/zOuFpqygCRkL4b45ilGAiKUn69cWLlbtJbXDp7kgCv S9ydLOhEhhkJYZN0SSa7Q3siYhFCVcvZLWKWFZe/bpKScPKcve/Oev/g8xvT6nMesmc8 7qnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=YtaPFkPRoWxBLYEwMWpUUFTWSWcEQ2h0j7gL6pS1rho=; b=WuZond6JNc+w2CPBBOqyqzyBxMEohhaI2jYspPKRBXn+pzYBEtfgbnjoQr7kkEQsoB JBGHtuGBc8fw4yISDnNc+Ug80e8I+fzhdwEG8gzjLvHRc35UuFEYyBROJFGoUfmLMw2+ i5FnLd134TmC7QHKxtkGnR72OOfiRuvYwieXXfEj7IF3AebT+3PjwYVzkNelmdGDIY5G riT9qmDD+kjNQBOhmPlHnpL58gu+VoqskEUblMrRUbJsItdFM7rTaNAnRS/sQLeyBVrJ 4UG4plEhlPyWmkOKqWxswf8RSBTnNUanBh9kQsaoXi2T2sr2gDxVDWxTtXwJDbYKv7fz iZFQ== X-Gm-Message-State: ALQs6tAF81+Cj63WKkE8okCWy4uPo0UkJyUAPs4/sJRmRlUVVirUG5EF mPsHVAjcsUQoryXt15GVKT1Nu91qsng= X-Google-Smtp-Source: AB8JxZpJXvBnzt3s71ViHIX24QwVsX/qJBQLaVuk8cweA0HXM5FQyTZzjIJqlspbF8h6aMudINqcFA== X-Received: by 2002:a63:6706:: with SMTP id b6-v6mr16788121pgc.214.1525282486938; Wed, 02 May 2018 10:34:46 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:180::1:24e1]) by smtp.gmail.com with ESMTPSA id w184-v6sm17757388pgb.20.2018.05.02.10.34.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 10:34:46 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: Jens Axboe , kernel-team@fb.com Subject: [PATCH 6/7] block: move blk_stat_add() to __blk_mq_end_request() Date: Wed, 2 May 2018 10:34:25 -0700 Message-Id: X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval We want this next to blk_account_io_done() for the next change so that we can call ktime_get() only once for both. Signed-off-by: Omar Sandoval --- block/blk-mq.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 9fa8069af032..65141edda189 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -490,6 +490,11 @@ EXPORT_SYMBOL_GPL(blk_mq_free_request); inline void __blk_mq_end_request(struct request *rq, blk_status_t error) { + if (rq->rq_flags & RQF_STATS) { + blk_mq_poll_stats_start(rq->q); + blk_stat_add(rq); + } + blk_account_io_done(rq); if (rq->end_io) { @@ -529,10 +534,6 @@ static void __blk_mq_complete_request(struct request *rq) if (rq->internal_tag != -1) blk_mq_sched_completed_request(rq); - if (rq->rq_flags & RQF_STATS) { - blk_mq_poll_stats_start(rq->q); - blk_stat_add(rq); - } if (!test_bit(QUEUE_FLAG_SAME_COMP, &rq->q->queue_flags)) { rq->q->softirq_done_fn(rq);