Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp205313ybp; Thu, 10 Oct 2019 16:37:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtA3RdcZbJcFEuq5jvF7LSson5EnP65waJ2MuKiNJ0D9vZBz0qXwZwvxGMi2W+YPKhVwXk X-Received: by 2002:a17:906:6451:: with SMTP id l17mr10788831ejn.114.1570750650009; Thu, 10 Oct 2019 16:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570750650; cv=none; d=google.com; s=arc-20160816; b=jq2z9AjLan1sDtUsWQgT1hfHBzNFl4Cu+KrWYkzUnj2yif3bSryru0m/3ox/rrNq7G 34UYH5xlgTanQQTmLeoKhRmmw3JiPNV/uuOebEBRJFxnfOAX468ZmM4QDPGZA4MiOI8n ng8bPzBD28OlPuAli8FKsa6LwZyv8jnA/0c8bmo4y152E7qOStI0y9WbLJILteapoc6Q cuktbp9Ke8XX8xOOIgf1yNkHuGOh46IxovJl/W0NvNs6ZoT6beFNoF5eaBtOIc7mBrXc JaVprVPSTI8r+UwkixYzT3hYohnQ0v092mlg0U6nSxcuMNWgKTvzDS9q2nk9aX6EhKxY WFlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:message-id:date:cc:to:from; bh=uKwQJosrGLyP93GDV7Cjl/pLlb4QnTZA39aPbPe8YtQ=; b=lKeGGfLvzyrhSD/6lNItLCVOstYbr6138I/hXZ71UOXWLQC0njGMe68SSuiEKa7p9B 1WTKyLY+tImsfcX2C3A5GH5/fvjYdrgT6f/wAeJfEsj8IB4mnhf7VWqBV26e9MqZlxAE UiT9CwmtgTr3y9qmvPjv/KdSsDsduI78ohRvwrwKvtKP8IHJyuM35EBESXHz9TNU04Wa 5H4c6lAcwR7WeuedPd6wpUisBvG1CuD9hV3NvOy4uKooRt0gMFZ0ofap9OSiTTzvO38e MPwnJ19VNZKGdXtBELbb5grC0UEZlA5Bo/KIgbH/NBiaSjmDEwCerDFuWZd08fsowjB7 s7QA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si4391238eds.375.2019.10.10.16.37.06; Thu, 10 Oct 2019 16:37:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727224AbfJJXgb (ORCPT + 99 others); Thu, 10 Oct 2019 19:36:31 -0400 Received: from ale.deltatee.com ([207.54.116.67]:57852 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbfJJXga (ORCPT ); Thu, 10 Oct 2019 19:36:30 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIhyu-0006HU-S1; Thu, 10 Oct 2019 17:36:29 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1iIhyt-0004Al-Fl; Thu, 10 Oct 2019 17:36:27 -0600 From: Logan Gunthorpe To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe Cc: Stephen Bates , Logan Gunthorpe , Christoph Hellwig Date: Thu, 10 Oct 2019 17:36:26 -0600 Message-Id: <20191010233626.15998-1-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, sbates@raithlin.com, logang@deltatee.com, hch@lst.de X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NO_TEXT autolearn=ham autolearn_force=no version=3.4.2 Subject: [PATCH] block: account statistics for passthrough requests X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Presently, passthrough requests are not accounted for because blk_do_io_stat() expressly rejects them. Based on some digging in the history, this doesn't seem like a concious decision but one that evolved from the change from blk_fs_request() to blk_rq_is_passthrough(). To support this, call blk_account_io_start() in blk_execute_rq_nowait() and remove the passthrough check in blk_do_io_stat(). Link: https://lore.kernel.org/linux-block/20191010100526.GA27209@lst.de/ Signed-off-by: Logan Gunthorpe Cc: Jens Axboe Cc: Christoph Hellwig --- This change is needed for the NVMe-of passthru work that is in progress. Christoph suggested sending it as its own patch. (See the link in the commit message for more information.) block/blk-exec.c | 2 ++ block/blk.h | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/block/blk-exec.c b/block/blk-exec.c index 1db44ca0f4a6..e20a852ae432 100644 --- a/block/blk-exec.c +++ b/block/blk-exec.c @@ -55,6 +55,8 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, rq->rq_disk = bd_disk; rq->end_io = done; + blk_account_io_start(rq, true); + /* * don't check dying flag for MQ because the request won't * be reused after dying flag is set diff --git a/block/blk.h b/block/blk.h index 47fba9362e60..2bea40180b6f 100644 --- a/block/blk.h +++ b/block/blk.h @@ -242,14 +242,11 @@ int blk_dev_init(void); * Contribute to IO statistics IFF: * * a) it's attached to a gendisk, and - * b) the queue had IO stats enabled when this request was started, and - * c) it's a file system request + * b) the queue had IO stats enabled when this request was started */ static inline bool blk_do_io_stat(struct request *rq) { - return rq->rq_disk && - (rq->rq_flags & RQF_IO_STAT) && - !blk_rq_is_passthrough(rq); + return rq->rq_disk && (rq->rq_flags & RQF_IO_STAT); } static inline void req_set_nomerge(struct request_queue *q, struct request *req) -- 2.20.1