mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Zhang Zekun <zhangzekun11@huawei.com>, joro@8bytes.org, will@kernel.org
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	baolu.lu@linux.intel.com, robh@kernel.org, nicolinc@nvidia.com,
	john.g.garry@oracle.com, kevin.tian@intel.com
Subject: Re: [RESEND PATCH 0/2] iommu/iova: optimize the iova rcache
Date: Fri, 11 Aug 2023 14:25:31 +0100	[thread overview]
Message-ID: <3576aade-d13a-c887-d26b-fd157b82b9a5@arm.com> (raw)
In-Reply-To: <20230811130246.42719-1-zhangzekun11@huawei.com>

On 2023-08-11 14:02, Zhang Zekun wrote:
> The number of iova_cpu_rcache can grow with the number of cpus in
> iova_rcache, but the size of rcache->depot will not. The deeper of
> rcache->depot can help iova_rcache cache more iovas, and can help
> iova_rcache better dealing with senarios in which drivers allocating
> and free iovas on different cpu cores. We only let the size of rcache->depot
> to grow with the number of cpus which is larger than 32 to avoid potential
> performance decrease on machines which don't have much cpus.

Oh, that reminds me I had started working on this again just before I 
was off, only my plan was to get rid of the depot allocation 
altogether[1]. However I wanted to finish the second patch on that 
branch (to reclaim wasted memory from the depot if the workload changes) 
before posting anything - I was feeling really pleased that I'd made it 
work until I realised it was leaking all the actual IOVAs... :(

Thanks,
Robin.

[1] 
https://gitlab.arm.com/linux-arm/linux-rm/-/commit/2f37ebe93eb282b534bf9e0fd4adc66cfe4b6693

> 
> Also, it is unsafe to directly free cpu rcache magazines in free_iova_rcaches,
> add check before freeing it.
> 
> Zhang Zekun (2):
>    iommu/iova: Add check for cpu_rcache in free_iova_rcaches
>    iommu/iova: allocate iova_rcache->depot dynamicly
> 
>   drivers/iommu/iova.c | 36 +++++++++++++++++++++++++++++++-----
>   1 file changed, 31 insertions(+), 5 deletions(-)
> 

      parent reply	other threads:[~2023-08-11 13:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11 13:02 Zhang Zekun
2023-08-11 13:02 ` [RESEND PATCH 1/2] iommu/iova: Add check for cpu_rcache in free_iova_rcaches Zhang Zekun
2023-08-11 13:32   ` Robin Murphy
2023-08-12  2:21     ` zhangzekun (A)
2023-08-11 13:02 ` [RESEND PATCH 2/2] iommu/iova: allocate iova_rcache->depot dynamicly Zhang Zekun
2023-08-11 14:14   ` John Garry
2023-08-12  7:18     ` zhangzekun (A)
2023-08-15 15:15       ` John Garry
2023-08-16  3:40         ` zhangzekun (A)
2023-08-11 13:25 ` Robin Murphy [this message]

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=3576aade-d13a-c887-d26b-fd157b82b9a5@arm.com \
    --to=robin.murphy@arm.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=john.g.garry@oracle.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robh@kernel.org \
    --cc=will@kernel.org \
    --cc=zhangzekun11@huawei.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

all inboxes | Powered by JetHome®