Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11171671ybi; Thu, 25 Jul 2019 11:12:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoJouOE1HGGgOhlQkJEt1Q6qIkCiEin3ia2FekFpLtcaVTaPv4hyGRpR1SoJEAnRF2PYcJ X-Received: by 2002:a17:90a:bf02:: with SMTP id c2mr94752748pjs.73.1564078378464; Thu, 25 Jul 2019 11:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564078378; cv=none; d=google.com; s=arc-20160816; b=goG815JiVs/8+MrDI2xpWD3GfMrrvrrhhD8y0Py+yJGz2mmERPhKqyj3SqDsUwspJQ eD8S04mrbOr53VGH8G78Dbbix4uTjzP9Py5leXSFeKKvyBMFMruAnzJuvr2ySWpayNd3 r/Obg/6cLAl6r7LtHg5JjFF7RCtFO8we5vxOeHIwl0qiaNfbxTqnT2lh66wXyGbI8ITN bzR0xbkYT937RFLWq3kConjn+UHpQwyYbLdOzdi2l14/jmoL4/RD3AwCdYIGcIfipHSV qzt3m/a3P+KIlqmOSJJHMB0FCTVN8cGVDcRjKsw2NuRcewe0ItQeq7U8NxEf9c5Y+KSX HS+Q== 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:references:in-reply-to:message-id:date:cc:to:from; bh=CijjhwRaUQeH4bR8AvChyTlFZDcQE/T5bH7LGodHNKw=; b=SUEiBZJD8efTIfZLhacJPT5SQ1GvEyn7SiiLY11fZWZWfll+LtUPY8QCE20Oz4QFw/ 9n1qMDLKD3fPaq2UQTb3NZKZ6veW5EIhEG2MT21f1L+fx+hWpr3q9FkiTuWm4iFm+w3b HZZFdNSzbDnZ7tulmFlSy+QxwBSSOm20hx7ZO5RwNgOlMZzzcAtDnhkucekU5uqDF7Pa r4cYMUE+Efs0v0Tqvzrflfb7Nk2zRcKghbBYJ3z5ymHHBHqCztDBoHEWLq4OjYjmWyqI ZheShm1nYcT1hum2icqPJmVXEaS/thZJQTz/5ny9j9NDMtO2zvMdJ8KJrUBNZKDHwaY5 BzYQ== 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 j185si17788974pge.91.2019.07.25.11.12.43; Thu, 25 Jul 2019 11:12:58 -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 S2391291AbfGYRYa (ORCPT + 99 others); Thu, 25 Jul 2019 13:24:30 -0400 Received: from ale.deltatee.com ([207.54.116.67]:39706 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391101AbfGYRXw (ORCPT ); Thu, 25 Jul 2019 13:23:52 -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 1hqhSw-0001Jh-Ff; Thu, 25 Jul 2019 11:23:51 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1hqhSw-0001ni-An; Thu, 25 Jul 2019 11:23:42 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Christoph Hellwig , Sagi Grimberg , Keith Busch , Jens Axboe , Chaitanya Kulkarni , Max Gurtovoy , Stephen Bates , Logan Gunthorpe Date: Thu, 25 Jul 2019 11:23:33 -0600 Message-Id: <20190725172335.6825-15-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190725172335.6825-1-logang@deltatee.com> References: <20190725172335.6825-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@lst.de, sagi@grimberg.me, kbusch@kernel.org, axboe@fb.com, Chaitanya.Kulkarni@wdc.com, maxg@mellanox.com, sbates@raithlin.com, logang@deltatee.com 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 v6 14/16] block: don't check blk_rq_is_passthrough() in blk_do_io_stat() 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 Instead of checking blk_rq_is_passthruough() for every call to blk_do_io_stat(), don't set RQF_IO_STAT for passthrough requests. This should be equivalent, and opens the possibility of passthrough requests specifically requesting statistics tracking. Signed-off-by: Logan Gunthorpe --- block/blk-mq.c | 2 +- block/blk.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index b038ec680e84..b8d41d6824f6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -318,7 +318,7 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, rq->cmd_flags = op; if (data->flags & BLK_MQ_REQ_PREEMPT) rq->rq_flags |= RQF_PREEMPT; - if (blk_queue_io_stat(data->q)) + if (blk_queue_io_stat(data->q) && !blk_rq_is_passthrough(rq)) rq->rq_flags |= RQF_IO_STAT; INIT_LIST_HEAD(&rq->queuelist); INIT_HLIST_NODE(&rq->hash); diff --git a/block/blk.h b/block/blk.h index de6b2e146d6e..554efa769bfe 100644 --- a/block/blk.h +++ b/block/blk.h @@ -234,13 +234,12 @@ int blk_dev_init(void); * * 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 + * c) it's a file system request (RQF_IO_STAT will not be set otherwise) */ 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); + (rq->rq_flags & RQF_IO_STAT); } static inline void req_set_nomerge(struct request_queue *q, struct request *req) -- 2.20.1