From: John Garry <john.garry@huawei.com>
To: Peng Zhang <zhangpeng.00@bytedance.com>,
Ethan Zhao <haifeng.zhao@linux.intel.com>, <joro@8bytes.org>,
<will@kernel.org>
Cc: <iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<robin.murphy@arm.com>
Subject: Re: [PATCH v2] iommu/iova: Optimize alloc_iova with rbtree_augmented
Date: Thu, 1 Sep 2022 11:45:58 +0100 [thread overview]
Message-ID: <1351998d-4fd7-dffb-c1fa-a0b1ca759123@huawei.com> (raw)
In-Reply-To: <4527c925-076b-a477-4ff8-697d75f16761@bytedance.com>
On 26/08/2022 11:28, Peng Zhang wrote:
>
>> Though only 3-4 drivers use alloc_iova() directly, in my understanding
>>
>> your test has simulated the worst case, rcache doesn't work at all,
>>
>> "alloc_iova" +“remove_iova” number looks great for worst case.
>
> There is another case, when the size to allocate greater to 2^5, even if
> alloc_iova_fast() is used, alloc_iova() will always be called because
> the maximum iova size that rcache supports to allocate is 32.
> IOVA_RANGE_CACHE_MAX_SIZE specifies the maximum size.
>
If you really have a performance issue with alloc_iova_fast() ->
alloc_iova() then I suggest that you consider trying to use
dma_opt_mapping_size() to teach the DMA engine driver to not create
requests whose overall size exceeds to the rcache limit.
Thanks,
John
next prev parent reply other threads:[~2022-09-01 10:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 9:51 [PATCH v2] iommu/iova: Optimize alloc_iova with rbtree_augmented Peng Zhang
2022-08-24 12:30 ` Ethan Zhao
2022-08-25 8:10 ` [External] " Peng Zhang
2022-08-26 8:58 ` Ethan Zhao
2022-08-26 10:28 ` Peng Zhang
2022-09-01 10:45 ` John Garry [this message]
2022-09-02 3:30 ` Peng Zhang
2022-09-21 1:15 ` wangjie (L)
2022-09-21 3:55 ` Peng Zhang
2022-09-21 10:54 ` wangjie (L)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351998d-4fd7-dffb-c1fa-a0b1ca759123@huawei.com \
--to=john.garry@huawei.com \
--cc=haifeng.zhao@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=zhangpeng.00@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).