From patchwork Fri Aug 27 12:01:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 503385 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1197701jab; Fri, 27 Aug 2021 05:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUjvTWCVvpRi8scjqGP4SEOOA5g7qOprmkaeW9dhZHJKD2kqbFqRibEa1dqJiPzfBYb1Gp X-Received: by 2002:a17:907:10cc:: with SMTP id rv12mr9477368ejb.423.1630066018630; Fri, 27 Aug 2021 05:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630066018; cv=none; d=google.com; s=arc-20160816; b=FPCycTs6z7mtVxcVC8awaEc3F9TNHmqmcZWfurnwN9TYrev3gMpahQoqWzUkPn2Wti 2/WUq2JtXFdxoroFkCHy8SgP99su0FlEP5YUwMrnEeSbPgFxp/Ka/X8VdzG6LPhBDFPb X10U9hDx3+hRDdiAe5M4IEGotxvAk4vA1qzHLPcTOYUpBkw1l1EOJ9X0NAHPU20An5dg 1Hk6NILdmbbXaQpLMIIPabsH5RNrOzXEHVSxL8XPtfBkx3YcOd17PYd4bBhTva8xZuZt p04bvncWgNo8yeAXfumA4sFVlvf4W/7ueJlyOPcc/wrj/XBPqMNgk+HAqYJuPIe6tmqC DROA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=gkfH0F0DDkkN6qt2+0c4lnzjJhY3CWO9UgP6w08HECA=; b=aLal04hbkDXnSB0nFPt7xAilJdoT1KsO4A20oqKO82/t5QYr5yxbQnSW24XO7O5WJL ++QM7saeoTJGQLNFi4qDtzafsX4a45pAnq4Ylp7i3LqwXS8rHhwXZPbF+n7nkUPlkMiI ymiHQsOKraACDRpyLmPzBaZ2SCZhMAwkhFjLZbMSTw0/w63aMqdE8dK/c7C8D1lG1xa5 JOUL+P+N7LKTj7dF0T7hdG7HzUHv3LlTugWvatlE3VH48t10NDKIDDf8x0nUtIxjl67g z4sPmLyvqOeY1pVyaXw9yz1hOvVe7cLzRP7eTMXFvcBvAAAM+IHg8tQxHqwZ3JyRe9JL I6rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ne32si5450103ejc.27.2021.08.27.05.06.58 for ; Fri, 27 Aug 2021 05:06:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245108AbhH0MHo (ORCPT ); Fri, 27 Aug 2021 08:07:44 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3697 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245112AbhH0MHn (ORCPT ); Fri, 27 Aug 2021 08:07:43 -0400 Received: from fraeml745-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Gwz1q26Rvz67YT1; Fri, 27 Aug 2021 20:05:35 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml745-chm.china.huawei.com (10.206.15.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 27 Aug 2021 14:06:52 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 27 Aug 2021 13:06:50 +0100 From: John Garry To: CC: , , , , John Garry Subject: [PATCH v3 02/13] block: Rename BLKDEV_MAX_RQ -> BLKDEV_DEFAULT_RQ Date: Fri, 27 Aug 2021 20:01:53 +0800 Message-ID: <1630065724-69146-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1630065724-69146-1-git-send-email-john.garry@huawei.com> References: <1630065724-69146-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org It is a bit confusing that there is BLKDEV_MAX_RQ and MAX_SCHED_RQ, as the name BLKDEV_MAX_RQ would imply the max requests always, which it is not. Rename to BLKDEV_MAX_RQ to BLKDEV_DEFAULT_RQ, matching its usage - that being the default number of requests assigned when allocating a request queue. Signed-off-by: John Garry Reviewed-by: Ming Lei --- block/blk-core.c | 2 +- block/blk-mq-sched.c | 2 +- block/blk-mq-sched.h | 2 +- drivers/block/rbd.c | 2 +- include/linux/blkdev.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) -- 2.26.2 diff --git a/block/blk-core.c b/block/blk-core.c index 0874bc2fcdb4..93b585593ebd 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -569,7 +569,7 @@ struct request_queue *blk_alloc_queue(int node_id) blk_queue_dma_alignment(q, 511); blk_set_default_limits(&q->limits); - q->nr_requests = BLKDEV_MAX_RQ; + q->nr_requests = BLKDEV_DEFAULT_RQ; return q; diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 0f006cabfd91..2231fb0d4c35 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -606,7 +606,7 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e) * Additionally, this is a per-hw queue depth. */ q->nr_requests = 2 * min_t(unsigned int, q->tag_set->queue_depth, - BLKDEV_MAX_RQ); + BLKDEV_DEFAULT_RQ); queue_for_each_hw_ctx(q, hctx, i) { ret = blk_mq_sched_alloc_tags(q, hctx, i); diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index 5246ae040704..1e46be6c5178 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h @@ -5,7 +5,7 @@ #include "blk-mq.h" #include "blk-mq-tag.h" -#define MAX_SCHED_RQ (16 * BLKDEV_MAX_RQ) +#define MAX_SCHED_RQ (16 * BLKDEV_DEFAULT_RQ) void blk_mq_sched_assign_ioc(struct request *rq); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index e65c9d706f6f..bf60aebd0cfb 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -836,7 +836,7 @@ struct rbd_options { u32 alloc_hint_flags; /* CEPH_OSD_OP_ALLOC_HINT_FLAG_* */ }; -#define RBD_QUEUE_DEPTH_DEFAULT BLKDEV_MAX_RQ +#define RBD_QUEUE_DEPTH_DEFAULT BLKDEV_DEFAULT_RQ #define RBD_ALLOC_SIZE_DEFAULT (64 * 1024) #define RBD_LOCK_TIMEOUT_DEFAULT 0 /* no timeout */ #define RBD_READ_ONLY_DEFAULT false diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c9cb12483e12..fc3987eda2c1 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -44,7 +44,7 @@ struct blk_stat_callback; struct blk_keyslot_manager; #define BLKDEV_MIN_RQ 4 -#define BLKDEV_MAX_RQ 128 /* Default maximum */ +#define BLKDEV_DEFAULT_RQ 128 /* Must be consistent with blk_mq_poll_stats_bkt() */ #define BLK_MQ_POLL_STATS_BKTS 16