From patchwork Wed May 9 09:08:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10388829 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 B2A6D60170 for ; Wed, 9 May 2018 09:09:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3EF028B9C for ; Wed, 9 May 2018 09:09:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98C9628D9B; Wed, 9 May 2018 09:09:12 +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 449F828B9C for ; Wed, 9 May 2018 09:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934270AbeEIJJK (ORCPT ); Wed, 9 May 2018 05:09:10 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40476 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934189AbeEIJJI (ORCPT ); Wed, 9 May 2018 05:09:08 -0400 Received: by mail-pg0-f65.google.com with SMTP id l2-v6so22386975pgc.7 for ; Wed, 09 May 2018 02:09:08 -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=vml4qQhaSXgU3nTbLpoE0vZ3+o3CE1l6wm73ok6evnk=; b=UlH5MPlKdXSwUywdOF7QKc2gMflkH84hwGEuq6Qn2yUq3x8MSDuj864vLmQ+lffNQZ AIP5U9iNsjd6at9Cs7mDMlpO57n/G/jmVieXntU+z9eoymUx99sh2mA5Q4yTTGIBmEb9 KvXmJEATvPNwLmdcgWVQp6r58yib7dr0q7ADrd50OB3/f1dJ8lw/gvuU9qFi+XJ9LZI6 gLzTGZE156PQYPrXuRcLattLRSTqT/kLgoq/jbu7rT92iw/H+h9uB+IEhJrZoIPEPzy3 lFXE5uJdPjxfcz5EkPiJ1Ii9KMjdHZje6Y/HuIJeUp4exQelMzEqOdQCASF+NkokbM9B Kbog== 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=vml4qQhaSXgU3nTbLpoE0vZ3+o3CE1l6wm73ok6evnk=; b=smYQvJ/7PymgFI6mOWD33WC6PeVTjziHF/ZmC8RqvO2fO6V/340cK4gKtuTSATeucd Buh0AUOy7uczXizWDt7XEdbC6BP2jRPcqI8xn/dXXx7f9bEhxQhpLPtGkCvhLl5Lgro4 6+YBm+8D7pnKWvFgGookXPedPyuVN7SUZ7+Umy9y/UQ+esfUUwL6+rEJDPuU6RTeSk1g 8IssV2D1g/loPFYi+oMASuRsNehTsr7lp9IcRjC/GfnyHKe5cVWAJVwZMnMg4D3aIuQ7 Qc2i58Y9uYIeB3XhqJwSol8q3mlqJuVpdDjqcKX/9h4pnz8nzvG5Addm9dnnS1RLw0OF MfoA== X-Gm-Message-State: ALQs6tD3zIkEwaIQ1bpCknpPDgnMrQBq22qFlRsiIK2TdR8VHxihLcMm 9r4pgnZ5/hSZMRvDBNKrGG0rGh+BvUk= X-Google-Smtp-Source: AB8JxZqzbwyGhzgZmypPOuOiE8Ro3NSiSogQkHZ+JqLH30oUSXKSaopASYP9ld8DOPytOwbRKVUUww== X-Received: by 10.98.196.133 with SMTP id h5mr43960663pfk.86.1525856947752; Wed, 09 May 2018 02:09:07 -0700 (PDT) Received: from vader.hsd1.wa.comcast.net ([2601:602:8800:a9a9:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id s17sm60429576pfi.165.2018.05.09.02.09.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 02:09:06 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: Jens Axboe , kernel-team@fb.com Subject: [PATCH v3 6/7] block: move blk_stat_add() to __blk_mq_end_request() Date: Wed, 9 May 2018 02:08:52 -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 17612e04d041..39b4e9834d82 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -506,6 +506,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) { @@ -545,10 +550,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);