All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Steven Sistare <steven.sistare@oracle.com>
Cc: iommu@lists.linux.dev, Kevin Tian <kevin.tian@intel.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>
Subject: Re: [RFC V1 0/4] iommufd live update
Date: Wed, 21 Aug 2024 15:04:00 -0300	[thread overview]
Message-ID: <20240821180400.GM3773488@nvidia.com> (raw)
In-Reply-To: <ffa07fb2-6554-40cc-8af6-e6b3a2cfacdc@oracle.com>

On Wed, Aug 21, 2024 at 01:54:04PM -0400, Steven Sistare wrote:

> memfd_pin_folios() returns an array of folios which must be saved and
> later passed back to unpin_folios().   That's a slight bummer, since
> currently you save memory by retrieving PFNs from the iommu as needed,
> rather than saving all of them explicitly (with the exception of pinned_pfns).

You wouldn't save the folios directly. The existing PFN mechanism is
fine and already works with folios memory.

The mismatch betwen gup returning pages and memfd_pin_folios returning
folios is fixed up by adjusting the folio refcount back to page
granularity, then treating it the same as a bunch of pages and using
unpin_user_pages() as normal.

gup.c already has code that can do this adjustment it would probably
need to be exported. Something like:

folio_refs_to_pages(folio, len);

Then don't change very much in iommufd, just stuff the folio's PFNs
into the existing reader mechanism the same as the pin_user_pages()
flow after fixing the refcount.

Jason

  reply	other threads:[~2024-08-21 18:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-20 18:56 [RFC V1 0/4] iommufd live update Steve Sistare
2024-07-20 18:56 ` [RFC V1 1/4] iommufd: Export do_update_pinned Steve Sistare
2024-07-20 18:56 ` [RFC V1] iommufd debug print Steve Sistare
2024-07-20 19:01   ` Steven Sistare
2024-07-20 18:56 ` [RFC V1 2/4] iommufd: Lock all objects Steve Sistare
2024-07-22 15:37   ` Jason Gunthorpe
2024-08-05 19:01     ` Steven Sistare
2024-09-26 14:00       ` Steven Sistare
2024-07-20 18:56 ` [RFC V1 3/4] iommufd: Add IOMMU_IOAS_CHANGE_PROCESS Steve Sistare
2024-07-20 18:56 ` [RFC V1 4/4] iommufd: update VA Steve Sistare
2024-07-22 15:51   ` Jason Gunthorpe
2024-08-05 19:02     ` Steven Sistare
2024-08-06 12:54       ` Jason Gunthorpe
2024-07-20 19:21 ` [RFC V1 0/4] iommufd live update Steven Sistare
2024-07-22 15:55 ` Jason Gunthorpe
2024-08-05 19:03   ` Steven Sistare
2024-08-06 12:56     ` Jason Gunthorpe
2024-08-08 19:15       ` Steven Sistare
2024-08-08 19:52         ` Jason Gunthorpe
2024-08-12 17:41           ` Steven Sistare
2024-08-19 14:59             ` Jason Gunthorpe
2024-08-21 17:54               ` Steven Sistare
2024-08-21 18:04                 ` Jason Gunthorpe [this message]
2024-08-22 21:05                   ` Steven Sistare
2024-08-22 21:10                     ` Jason Gunthorpe
2024-07-23 12:48 ` Jason Gunthorpe
2024-08-05 19:02   ` Steven Sistare

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=20240821180400.GM3773488@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=kevin.tian@intel.com \
    --cc=steven.sistare@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.