From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4C26C433EF for ; Mon, 28 Feb 2022 09:44:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 8CF5081402; Mon, 28 Feb 2022 09:44:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1fuXCD-MJBym; Mon, 28 Feb 2022 09:44:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id F41D7813F2; Mon, 28 Feb 2022 09:44:26 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D3D2DC0077; Mon, 28 Feb 2022 09:44:26 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 85B1FC001A; Mon, 28 Feb 2022 09:44:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 81B89813F2; Mon, 28 Feb 2022 09:44:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GixQKN3fojki; Mon, 28 Feb 2022 09:44:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 26598813F1; Mon, 28 Feb 2022 09:44:24 +0000 (UTC) Received: from fraeml714-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4K6b6729ZDz67xv7; Mon, 28 Feb 2022 17:43:11 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml714-chm.china.huawei.com (10.206.15.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 28 Feb 2022 10:44:21 +0100 Received: from [10.47.86.223] (10.47.86.223) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.21; Mon, 28 Feb 2022 09:44:20 +0000 Message-ID: Date: Mon, 28 Feb 2022 09:44:19 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v5 0/5] iommu: Allow IOVA rcache range be configured To: , , References: <1644859746-20279-1-git-send-email-john.garry@huawei.com> In-Reply-To: <1644859746-20279-1-git-send-email-john.garry@huawei.com> X-Originating-IP: [10.47.86.223] X-ClientProxiedBy: lhreml708-chm.china.huawei.com (10.201.108.57) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Cc: mst@redhat.com, jasowang@redhat.com, linuxarm@huawei.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, hch@lst.de X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: John Garry via iommu Reply-To: John Garry Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 14/02/2022 17:29, John Garry wrote: Hi guys, And a friendly reminder on this series also. Cheers, john > For streaming DMA mappings involving an IOMMU and whose IOVA len regularly > exceeds the IOVA rcache upper limit (meaning that they are not cached), > performance can be reduced. > > This may be much more pronounced from commit 4e89dce72521 ("iommu/iova: > Retry from last rb tree node if iova search fails"), as discussed at [0]. > > IOVAs which cannot be cached are highly involved in the IOVA ageing issue, > as discussed at [1]. > > This series allows the IOVA rcache range be configured, so that we may > cache all IOVAs per domain, thus improving performance. > > A new IOMMU group sysfs file is added - max_opt_dma_size - which is used > indirectly to configure the IOVA rcache range: > /sys/kernel/iommu_groups/X/max_opt_dma_size > > This file is updated same as how the IOMMU group default domain type is > updated, i.e. must unbind the only device in the group first. > > The inspiration here comes from block layer request queue sysfs > "optimal_io_size" file, in /sys/block/sdX/queue/optimal_io_size > > Some old figures* for storage scenario (when increasing IOVA rcache range > to cover all DMA mapping sizes from the LLD): > v5.13-rc1 baseline: 1200K IOPS > With series: 1800K IOPS > > All above are for IOMMU strict mode. Non-strict mode gives ~1800K IOPS in > all scenarios. > > Based on v5.17-rc4 + [2] > * I lost my high data throughout test setup > > Differences to v4: > https://lore.kernel.org/linux-iommu/1626259003-201303-1-git-send-email-john.garry@huawei.com/ > - Major rebase > - Change the "Refactor iommu_group_store_type()" to not use a callback > and an op type enum instead > - I didn't pick up Will's Ack as it has changed so much > - Use a domain feature flag to keep same default group type > - Add wrapper for default IOVA rcache range > - Combine last 2x patches > > [0] https://lore.kernel.org/linux-iommu/20210129092120.1482-1-thunder.leizhen@huawei.com/ > [1] https://lore.kernel.org/linux-iommu/1607538189-237944-1-git-send-email-john.garry@huawei.com/ > [2] https://lore.kernel.org/linux-iommu/20220203063345-mutt-send-email-mst@kernel.org/T/#m5b2b59576d35cad544314470f32e5f40ac5d1fe9 > > John Garry (5): > iommu: Refactor iommu_group_store_type() > iova: Allow rcache range upper limit to be flexible > iommu: Allow iommu_change_dev_def_domain() realloc same default domain > type > iommu: Allow max opt DMA len be set for a group via sysfs > iova: Add iova_len argument to iova_domain_init_rcaches() > > .../ABI/testing/sysfs-kernel-iommu_groups | 16 ++ > drivers/iommu/dma-iommu.c | 15 +- > drivers/iommu/iommu.c | 202 +++++++++++++----- > drivers/iommu/iova.c | 37 ++-- > drivers/vdpa/vdpa_user/iova_domain.c | 4 +- > include/linux/iommu.h | 7 + > include/linux/iova.h | 6 +- > 7 files changed, 212 insertions(+), 75 deletions(-) > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu