From patchwork Wed Aug 19 15:20:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 247977 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp561066ils; Wed, 19 Aug 2020 08:26:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFaZyou8W5qflNrf1vkSHzRWIS0C6Cnm/3DUurrMLzUEj2YPjyCPzERKjISKna5CLSucF6 X-Received: by 2002:a17:906:c18d:: with SMTP id g13mr25225040ejz.239.1597850786823; Wed, 19 Aug 2020 08:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597850786; cv=none; d=google.com; s=arc-20160816; b=aBI3mYrG+JtPM3A+6AFjHOpDek95AB6yYKASw1sRK25ut4ObDE7wmkEdb2FigHSi/l Y/JfZn1vUyGwRHOeA0wHFXvxDNJ6e5bPjQ2+8Y/pM6W4GngTRCT901iFw4q8yWYP99qX zyHABAyrMTfTJqkJ+yFcIwqLEmHpMkMtuzhX68KndcHb0jQmSIGtV6QTjZVDLS682EmR M8vWKkTlx4M7pSrjkcWETWwiU4rK9ybMWvchNTpRyB5LWO3jPdfJsTE6jItNkWVha+a+ NeV5NjxuzPGHFnIfVpKHI9WIlzp28BDU8iOpFNmHWHNLnA52fNLv6GGadwD8LF1TDXMo BtGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=qYHNa0TsXlixPYT7D5gVe6Eku1JL+DV3R8xvRLVhJ54=; b=XmngwlN0LIa1rnRxg845Gh5Y8KQEgATiaHHcVa+zO1agdHnZCOKJdpant89aJIjm2n tfJqe+jGFSHlshwuxW8pZi2pVuz5I/SOFAZAoxBLc8xCY0fKatpxkXDx/iHI8J9cSGy8 25hIaFnm/16Cw+RlRssAqWAL0f+f0dui8Z8q4ZSlr4ruRDeRY//z2a/6jEbFVjYqPGMF oNTatVJQ/WZE0oGR03XouFaDqc3GAjGzWc42p08t+jXBS77dyNDdTqjIEfZHfu76Lofh Z/eWGt441obvqx8/KBsAgOSi+dPhHFVbEvRSR8tkFuYhh0ViqjYfmYhH/CvhFBo3maZ0 k6qg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si15033731ejc.680.2020.08.19.08.26.26 for ; Wed, 19 Aug 2020 08:26:26 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728576AbgHSP0D (ORCPT ); Wed, 19 Aug 2020 11:26:03 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:39926 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728785AbgHSPZd (ORCPT ); Wed, 19 Aug 2020 11:25:33 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6A4E5B11DB585D6BBB3D; Wed, 19 Aug 2020 23:24:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Wed, 19 Aug 2020 23:24:51 +0800 From: John Garry To: , , , , , , , , , , CC: , , , , , , , , John Garry Subject: [PATCH v8 11/18] null_blk: Support shared tag bitmap Date: Wed, 19 Aug 2020 23:20:29 +0800 Message-ID: <1597850436-116171-12-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1597850436-116171-1-git-send-email-john.garry@huawei.com> References: <1597850436-116171-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Support a shared tag bitmap, whereby request tags are unique over all submission queues, and not just per submission queue. As such, per device total queue depth is normally hw_queue_depth * submit_queues, but hw_queue_depth when set. And a similar story for when shared_tags is set, where that is the queue depth over all null blk devices. Signed-off-by: John Garry --- drivers/block/null_blk_main.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.26.2 diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c index 47a9dad880af..19c04e074880 100644 --- a/drivers/block/null_blk_main.c +++ b/drivers/block/null_blk_main.c @@ -164,6 +164,10 @@ static bool shared_tags; module_param(shared_tags, bool, 0444); MODULE_PARM_DESC(shared_tags, "Share tag set between devices for blk-mq"); +static bool g_shared_tag_bitmap; +module_param_named(shared_tag_bitmap, g_shared_tag_bitmap, bool, 0444); +MODULE_PARM_DESC(shared_tag_bitmap, "Use shared tag bitmap for all submission queues for blk-mq"); + static int g_irqmode = NULL_IRQ_SOFTIRQ; static int null_set_irqmode(const char *str, const struct kernel_param *kp) @@ -1692,6 +1696,8 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set) set->flags = BLK_MQ_F_SHOULD_MERGE; if (g_no_sched) set->flags |= BLK_MQ_F_NO_SCHED; + if (g_shared_tag_bitmap) + set->flags |= BLK_MQ_F_TAG_HCTX_SHARED; set->driver_data = NULL; if ((nullb && nullb->dev->blocking) || g_blocking)