Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3699769rdb; Wed, 13 Sep 2023 22:58:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELMswLzhu9GTaP+dqcj8eHKryrBt9Nc1mD57uvFgYX66ptdlPg3fGoGz1L+u6+f8kl6wm1 X-Received: by 2002:a17:90a:d796:b0:26d:1f3d:6e85 with SMTP id z22-20020a17090ad79600b0026d1f3d6e85mr4112224pju.37.1694671099079; Wed, 13 Sep 2023 22:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694671099; cv=none; d=google.com; s=arc-20160816; b=TEbQqdih8e0LMZ3JHkp4oOdigDI+bL1TF2uucRpptNo+3vxHQ9KFOtL9+WF9Xn6J0C 3YqV3C0ndUjfGLfiDAC0E9zmANNaw4Ojrwb58BsvW/jGbAVhA+gIpkboyylpXkzRCilZ WW/HzVHeyA7yfEi7/Ji3b5hezl8CICOJT2udDxjaUHTlzjPvubLMCBz78DJpwj7WRyD8 5VP/m3hhY+NGbqztxRdXqeVJtUhmfG71Z3katVMYpMGQcSJZoFYax655iGTG7D9eUtss NW6nIQ0vsmyd1otXH/a9Bq+ChWhbHRncAMDJVtygMrmQdF1KCn+ZfCpUZgOQoj4RNFkw PktQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=54/TH6NwZmycBuSVYU7gHf61WfubLeQthagty1Zb+Ho=; fh=szS6nKOHqWqdmo+pDmdMHkpBM8bpzBlMJyKfLi9jRHY=; b=A2rAPFTBuR6mVFBxWLCPbFEqwBUIk4atgY9EN3qmhBIZrTLvM33FOBc1BIC66jkTo2 WZYI/SBA9kClTLT61aZq9SB8RBcKxJ19KqtQhFCkxDBIgUi5NASv2CDb7fZbHw7AXod7 SDZZbFx8cwML4l3fYCrmgvIVueqeDUgg7SV+HzKcubRHJG3y2PjCtHztSI6Xj1CY0y44 DzBm33OUPRMtTePGO6WQD3mNPJQuTfarNvln3j4nijNBqvjaCbmoEnj7+nLvrzzAu+m5 X3NFOZ23Ltr7sYXWSd5ctZklEIEYzCkGMKuQeKUokIbB50S2XE+vxsnEbBxNjCoJgyIQ DCMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NTumMwyN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ie18-20020a17090b401200b00262f937bf93si939122pjb.77.2023.09.13.22.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 22:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=NTumMwyN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3D1E584A6C4F; Wed, 13 Sep 2023 08:17:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241552AbjIMPRI (ORCPT + 99 others); Wed, 13 Sep 2023 11:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241665AbjIMPQi (ORCPT ); Wed, 13 Sep 2023 11:16:38 -0400 Received: from out-222.mta1.migadu.com (out-222.mta1.migadu.com [95.215.58.222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7363DC for ; Wed, 13 Sep 2023 08:16:34 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694618193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=54/TH6NwZmycBuSVYU7gHf61WfubLeQthagty1Zb+Ho=; b=NTumMwyNHBdjcIricrwm9zKU91F6+4vINw2RVn5cVHIyaTqrJSZE1Mg/sY1E8kCeupdeyr Mk+w9MGQRmxoZpZWD0F5Hqi3P6GnuNxVBtZuHXwpRoOTwqymnTnr6HMNHSW+Jrm7T5Bts+ GVowM6zQPg+BYhyrI4+b2Z2GeH1x8Pw= From: chengming.zhou@linux.dev To: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com, bvanassche@acm.org Cc: kbusch@kernel.org, mst@redhat.com, damien.lemoal@opensource.wdc.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, chengming.zhou@linux.dev, Chengming Zhou Subject: [PATCH v2 2/5] blk-mq: remove RQF_MQ_INFLIGHT Date: Wed, 13 Sep 2023 15:16:13 +0000 Message-Id: <20230913151616.3164338-3-chengming.zhou@linux.dev> In-Reply-To: <20230913151616.3164338-1-chengming.zhou@linux.dev> References: <20230913151616.3164338-1-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 08:17:26 -0700 (PDT) From: Chengming Zhou Since the previous patch change to only account active requests when we really allocate the driver tag, the RQF_MQ_INFLIGHT can be removed and no double account problem. 1. none elevator: flush request will use the first pending request's driver tag, won't double account. 2. other elevator: flush request will be accounted when allocate driver tag when issue, and will be unaccounted when it put the driver tag. Signed-off-by: Chengming Zhou --- block/blk-flush.c | 11 ++--------- block/blk-mq-debugfs.c | 1 - block/blk-mq.c | 4 ---- include/linux/blk-mq.h | 2 -- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/block/blk-flush.c b/block/blk-flush.c index e73dc22d05c1..3f4d41952ef2 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -323,16 +323,9 @@ static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq, flush_rq->mq_ctx = first_rq->mq_ctx; flush_rq->mq_hctx = first_rq->mq_hctx; - if (!q->elevator) { + if (!q->elevator) flush_rq->tag = first_rq->tag; - - /* - * We borrow data request's driver tag, so have to mark - * this flush request as INFLIGHT for avoiding double - * account of this driver tag - */ - flush_rq->rq_flags |= RQF_MQ_INFLIGHT; - } else + else flush_rq->internal_tag = first_rq->internal_tag; flush_rq->cmd_flags = REQ_OP_FLUSH | REQ_PREFLUSH; diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index c3b5930106b2..5cbeb9344f2f 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -246,7 +246,6 @@ static const char *const rqf_name[] = { RQF_NAME(STARTED), RQF_NAME(FLUSH_SEQ), RQF_NAME(MIXED_MERGE), - RQF_NAME(MQ_INFLIGHT), RQF_NAME(DONTPREP), RQF_NAME(SCHED_TAGS), RQF_NAME(USE_SCHED), diff --git a/block/blk-mq.c b/block/blk-mq.c index e776388decc3..c209a7dddee3 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1066,10 +1066,6 @@ static inline void blk_mq_flush_tag_batch(struct blk_mq_hw_ctx *hctx, { struct request_queue *q = hctx->queue; - /* - * All requests should have been marked as RQF_MQ_INFLIGHT, so - * update hctx->nr_active in batch - */ blk_mq_sub_active_requests(hctx, nr_tags); blk_mq_put_tags(hctx->tags, tag_array, nr_tags); diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 958ed7e89b30..1ab3081c82ed 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -32,8 +32,6 @@ typedef __u32 __bitwise req_flags_t; #define RQF_FLUSH_SEQ ((__force req_flags_t)(1 << 4)) /* merge of different types, fail separately */ #define RQF_MIXED_MERGE ((__force req_flags_t)(1 << 5)) -/* track inflight for MQ */ -#define RQF_MQ_INFLIGHT ((__force req_flags_t)(1 << 6)) /* don't call prep for this one */ #define RQF_DONTPREP ((__force req_flags_t)(1 << 7)) /* use hctx->sched_tags */ -- 2.40.1