Linux IOMMU Development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Robin Murphy <robin.murphy@arm.com>
Cc: "zhangzekun (A)" <zhangzekun11@huawei.com>,
	will@kernel.org, joro@8bytes.org, nicolinc@nvidia.com,
	mshavit@google.com, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/arm-smmu-v3: Add a threshold to avoid potential soft lockup
Date: Wed, 24 Jan 2024 12:28:08 -0400	[thread overview]
Message-ID: <20240124162808.GT50608@ziepe.ca> (raw)
In-Reply-To: <10c1980a-df07-4f69-93e5-c1c50b106a13@arm.com>

On Wed, Jan 24, 2024 at 12:17:43PM +0000, Robin Murphy wrote:

> I don't think the story here has changed from when I first remember this
> being discussed probably 7 or 8 years ago - what VFIO has always really
> wanted for this situation is to know when it's doing a complete teardown and
> just detach and free the domain, then unpin the pages afterwards, without
> wasting any time at all on frivolous unmapping. 

What VFIO/iommufd really wants is a fast way to to read back and unmap
the PFNs from the domain. Today it has to call iommu_iova_to_phys()
and then unmap which ends up walking the radix many times.

Ideally we'd batch read and unmap in a single call with a single radix
walk.

This is because the domain is used to store the 'struct page *' which
is needed to unpin the memory.

Combined with the no-attachments optimization I described it could be
pretty close to optimal.

Jason

      reply	other threads:[~2024-01-24 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 11:40 [PATCH] iommu/arm-smmu-v3: Add a threshold to avoid potential soft lockup Zhang Zekun
2024-01-15 15:31 ` Jason Gunthorpe
2024-01-18 11:21   ` zhangzekun (A)
2024-01-18 14:22     ` Jason Gunthorpe
2024-01-24 12:17       ` Robin Murphy
2024-01-24 16:28         ` Jason Gunthorpe [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=20240124162808.GT50608@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mshavit@google.com \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --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