[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220706121057.GF2403@willie-the-truck>
Date: Wed, 6 Jul 2022 13:10:58 +0100
From: Will Deacon <will@...nel.org>
To: John Garry <john.garry@...wei.com>
Cc: joro@...tes.org, robin.murphy@....com, mst@...hat.com,
jasowang@...hat.com, iommu@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
chenxiang66@...ilicon.com, thunder.leizhen@...wei.com,
jean-philippe@...aro.org, linuxarm@...wei.com
Subject: Re: [PATCH RESEND v5 2/5] iova: Allow rcache range upper limit to be
flexible
On Mon, Apr 04, 2022 at 07:27:11PM +0800, John Garry wrote:
> Some low-level drivers may request DMA mappings whose IOVA length exceeds
> that of the current rcache upper limit.
>
> This means that allocations for those IOVAs will never be cached, and
> always must be allocated and freed from the RB tree per DMA mapping cycle.
> This has a significant effect on performance, more so since commit
> 4e89dce72521 ("iommu/iova: Retry from last rb tree node if iova search
> fails"), as discussed at [0].
>
> As a first step towards allowing the rcache range upper limit be
> configured, hold this value in the IOVA rcache structure, and allocate
> the rcaches separately.
>
> Delete macro IOVA_RANGE_CACHE_MAX_SIZE in case it's reused by mistake.
>
> [0] https://lore.kernel.org/linux-iommu/20210129092120.1482-1-thunder.leizhen@huawei.com/
>
> Signed-off-by: John Garry <john.garry@...wei.com>
> ---
> drivers/iommu/iova.c | 20 ++++++++++----------
> include/linux/iova.h | 3 +++
> 2 files changed, 13 insertions(+), 10 deletions(-)
Acked-by: Will Deacon <will@...nel.org>
Will
Powered by blists - more mailing lists