From patchwork Wed May 2 21:32:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10376661 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 E4CE56037D for ; Wed, 2 May 2018 21:33:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D458C2866D for ; Wed, 2 May 2018 21:33:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0CB4287E3; Wed, 2 May 2018 21:33:18 +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 A12DC2866D for ; Wed, 2 May 2018 21:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751339AbeEBVdL (ORCPT ); Wed, 2 May 2018 17:33:11 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:45293 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751822AbeEBVdK (ORCPT ); Wed, 2 May 2018 17:33:10 -0400 Received: by mail-pg0-f66.google.com with SMTP id i29-v6so11544945pgn.12 for ; Wed, 02 May 2018 14:33:10 -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=D+tWxA9RF6181oqEIsqVmrnFvIKGntv+wAJ9iS+ICcTYzXEqTirHH/3lmx205miK7D sE5bYQOx4pUu53Pi5Nn9zH5AzTsRYOuzAjKlhW7O0YfLt3t/2lwhg92SQWVyRhvO/TQm JG5Mqk7+tdz0plZym8dPh+XNU0fGCiPNpa66jTZjgiAkwGj7dYHsDQGO1jxoijzpFKUr DrFGP0nmIszt+vKFfKnDUrPf4giMKM3Ymi0SazlX/h2aCF9nOCMov5DIq9nea833PlzJ o/auj3Quk4qcopJGugEfzbarT1a5gjdjZOCOeoOuq9zUr0GyML+ObhjM5iYXIYb9mD+b XpfQ== 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=UJnc/2KpeMRM10CB+VayJ1+Xw0P0+eeJXqPVfPT7jYvxW2C3yC04ttTn6kZL7I4GhT c+QmtgYiPytT9D3HpTqSL/KtlBjQzEOouJZAhl6hfvO3NzQJeJLE/Vo6vohg+uT8tKpm 2CrGXZfbLLaBfZB8d/yq9WDoW4/lFRMzm8kqBYorCxJ9UujKIZ8wWqhKeo7aRi3smXIR XGRYNRZsJy90Lgwl6LOjMYHMzn2872iG/7QfozGLI9PXSRmi6Urq32J+SgyRQbu+EALH EBN41scjajcNOBlB1rk0vYf3HyZTgaiAeJ3lEMOBfi92aSppEI3w3EkiymYb+fpZmA8/ 6b7w== X-Gm-Message-State: ALQs6tAuSoNVmTBSaylNswYDsJf7C0URthC0tqW+gXri1cOlKmOXru1a +Zw0bV8Rb7+PisXf2L2gh+4I09iAKiA= X-Google-Smtp-Source: AB8JxZqlcG3qroitwugX7tkmn6/FpKPcwGRr9wZriDH35LHhGnspy1MwM0tSE9cxbtOMht9v4qbioQ== X-Received: by 2002:a63:93:: with SMTP id 141-v6mr13615496pga.322.1525296789418; Wed, 02 May 2018 14:33:09 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:180::1:24e1]) by smtp.gmail.com with ESMTPSA id s6-v6sm9640492pgq.19.2018.05.02.14.33.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 14:33:08 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: Jens Axboe , kernel-team@fb.com, Josef Bacik Subject: [PATCH v2 6/7] block: move blk_stat_add() to __blk_mq_end_request() Date: Wed, 2 May 2018 14:32:44 -0700 Message-Id: <728efba0143eef9d37212d1b1def9ccc9b93c3af.1525296089.git.osandov@fb.com> 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);