Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp797461pxb; Wed, 29 Sep 2021 09:51:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOqdZauNMb+Nk0fxZFhg0bNVmbkFRRGQ3S+/KfQz5k7ax2qj+ONhMM8im/qacUJTdR+N1R X-Received: by 2002:a17:90a:1904:: with SMTP id 4mr984128pjg.190.1632934278505; Wed, 29 Sep 2021 09:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632934278; cv=none; d=google.com; s=arc-20160816; b=M+ppAmVdkid7g+JryLkKSQeMH4vfzVs8T/TBlzgYqBm/g32GGmwcCUavjXng9zVKG8 GEBJKcCXifpLks3g4DWMETPUXOtLy46n6XX66zMQRkrSIlzVt+qAW/gFigfbuZ9Qheef aTUnRC+08xq+T4rYvVXY5Z/uBU7O4bCuYOUtvSmsoogaRiwVCrEjCaI6QlzPY7tj+/++ iC71zy7O1fRZL4MdyzI/zTbNfN2ZRI/IgwNqi5aeQ/+sY0STJ+6asJex3aLikNCtodsk yvZT28+a6O2qZYBg1Y02ITI/2jxMEPyI69ZH4q2KaWgXeJwfae5JYdUDuJ9ptA5pgwQN P4Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject; bh=GGy2yWVJN7ZfQysX+olT4SOwcDtdWfoDKSfCZAzJlEE=; b=dx5qtiHyroOXbZu1eGc6QcZ2J+TeckTkeGgVDXVcKrKGMD5lJCJa/nNRJICwRm+8gr s4GDDR1euBXjjPrAthA2aXhSf2ynywuEjZXf64BHMTSW58BgbueF6SRFqzI8EgvL93mf M0KON7v3y4TeZK/aRdTpMJ6dNIzHmdQrVt8dlPGit5t9oFzaPGYH5spZadSk7W/sOFHa VgSELj7IM1WdJpqzf95kAWPZkvWg7RaXOH54qvu0n2zVBYqXCU4KmgN0ZrljRWWec2Zi DcCNLUGvLwWPTe+Jc5Q0ZIO9Wiy8cdUJUMb06UJ5qmS+EsR+oqxSL7N9c1CMBsjGhX3U RjDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 j1si362057pgb.31.2021.09.29.09.51.06; Wed, 29 Sep 2021 09:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1344227AbhI2Ne5 (ORCPT + 99 others); Wed, 29 Sep 2021 09:34:57 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3889 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344184AbhI2Nez (ORCPT ); Wed, 29 Sep 2021 09:34:55 -0400 Received: from fraeml734-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4HKHL31CWlz67mcQ; Wed, 29 Sep 2021 21:30:03 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml734-chm.china.huawei.com (10.206.15.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 29 Sep 2021 15:33:11 +0200 Received: from [10.47.26.77] (10.47.26.77) 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; Wed, 29 Sep 2021 14:33:10 +0100 Subject: Re: [PATCH v4 12/13] blk-mq: Use shared tags for shared sbitmap support From: John Garry To: Hannes Reinecke , CC: , , , , Kashyap Desai References: <1632472110-244938-1-git-send-email-john.garry@huawei.com> <1632472110-244938-13-git-send-email-john.garry@huawei.com> <9dd771bb-9e45-ecd2-d8e4-93c6e9cb9b59@suse.de> <49947654-591f-c686-5908-7938ab653e6d@huawei.com> Message-ID: <202668f9-8cf8-1ad7-414f-463353115eda@huawei.com> Date: Wed, 29 Sep 2021 14:36:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <49947654-591f-c686-5908-7938ab653e6d@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.26.77] X-ClientProxiedBy: lhreml714-chm.china.huawei.com (10.201.108.65) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/09/2021 11:39, John Garry wrote: > + Kashyap > > On 24/09/2021 11:23, Hannes Reinecke wrote: >> On 9/24/21 10:28 AM, John Garry wrote: >>> Currently we use separate sbitmap pairs and active_queues atomic_t for >>> shared sbitmap support. >>> >>> However a full sets of static requests are used per HW queue, which is >>> quite wasteful, considering that the total number of requests usable at >>> any given time across all HW queues is limited by the shared sbitmap >>> depth. >>> >>> As such, it is considerably more memory efficient in the case of shared >>> sbitmap to allocate a set of static rqs per tag set or request queue, >>> and >>> not per HW queue. >>> >>> So replace the sbitmap pairs and active_queues atomic_t with a shared >>> tags per tagset and request queue, which will hold a set of shared >>> static >>> rqs. >>> >>> Since there is now no valid HW queue index to be passed to the >>> blk_mq_ops >>> .init and .exit_request callbacks, pass an invalid index token. This >>> changes the semantics of the APIs, such that the callback would need to >>> validate the HW queue index before using it. Currently no user of shared >>> sbitmap actually uses the HW queue index (as would be expected). >>> >>> Continue to use term "shared sbitmap" for now, as the meaning is known. >>> >>> Signed-off-by: John Garry >>> --- >>>   block/blk-mq-sched.c   | 82 ++++++++++++++++++------------------- >>>   block/blk-mq-tag.c     | 61 ++++++++++------------------ >>>   block/blk-mq-tag.h     |  6 +-- >>>   block/blk-mq.c         | 91 +++++++++++++++++++++++------------------- >>>   block/blk-mq.h         |  5 ++- >>>   include/linux/blk-mq.h | 15 ++++--- >>>   include/linux/blkdev.h |  3 +- >>>   7 files changed, 125 insertions(+), 138 deletions(-) >>> >> The overall idea to keep the full request allocation per queue was to >> ensure memory locality for the requests themselves. >> When moving to a shared request structure we obviously loose that >> feature. >> >> But I'm not sure if that matters here; the performance impact might be >> too small to be measurable, seeing that we'll be most likely bound by >> hardware latencies anyway. >> >> Nevertheless: have you tested for performance regressions with this >> patchset? > > I have tested relatively lower rates, like ~450K IOPS, without any > noticeable regression. > >> I'm especially thinking of Kashyaps high-IOPS megaraid setup; if there >> is a performance impact that'll be likely scenario where we can >> measure it. >> > > I can test higher rates, like 2M IOPS, when I get access to the HW. > > @Kashyap, Any chance you can help test performance here? > >> But even if there is a performance impact this patchset might be >> worthwhile, seeing that it'll reduce the memory footprint massively. > > Sure, I don't think that minor performance improvements can justify the > excessive memory. > JFYI, with 6x SAS SSDs on my arm64 board, I see: Before (5.15-rc2 baseline): none: 445K IOPs, mq-deadline: 418K IOPs (fio read) After: none: 442K IOPs, mq-deadline: 407K IOPs (fio read) So only a marginal drop there for mq-deadline. I'll try my 12x SAS SSD setup when I get a chance. Kashyap is kindly also testing. Thanks