From: David Hildenbrand <david@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
peterx@redhat.com, mitchell.augustin@canonical.com,
clg@redhat.com, jgg@nvidia.com, akpm@linux-foundation.org,
linux-mm@kvack.org
Subject: Re: [PATCH v2 5/6] mm: Provide address mask in struct follow_pfnmap_args
Date: Wed, 19 Feb 2025 09:31:48 +0100 [thread overview]
Message-ID: <3d1315ab-ba94-46c2-8dbf-ef26454f7007@redhat.com> (raw)
In-Reply-To: <20250218222209.1382449-6-alex.williamson@redhat.com>
On 18.02.25 23:22, Alex Williamson wrote:
> follow_pfnmap_start() walks the page table for a given address and
> fills out the struct follow_pfnmap_args in pfnmap_args_setup().
> The address mask of the page table level is already provided to this
> latter function for calculating the pfn. This address mask can also
> be useful for the caller to determine the extent of the contiguous
> mapping.
>
> For example, vfio-pci now supports huge_fault for pfnmaps and is able
> to insert pud and pmd mappings. When we DMA map these pfnmaps, ex.
> PCI MMIO BARs, we iterate follow_pfnmap_start() to get each pfn to test
> for a contiguous pfn range. Providing the mapping address mask allows
> us to skip the extent of the mapping level. Assuming a 1GB pud level
> and 4KB page size, iterations are reduced by a factor of 256K. In wall
> clock time, mapping a 32GB PCI BAR is reduced from ~1s to <1ms.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: linux-mm@kvack.org
> Reviewed-by: Peter Xu <peterx@redhat.com>
> Reviewed-by: "Mitchell Augustin" <mitchell.augustin@canonical.com>
> Tested-by: "Mitchell Augustin" <mitchell.augustin@canonical.com>
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-02-19 8:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 22:22 [PATCH v2 0/6] vfio: Improve DMA mapping performance for huge pfnmaps Alex Williamson
2025-02-18 22:22 ` [PATCH v2 5/6] mm: Provide address mask in struct follow_pfnmap_args Alex Williamson
2025-02-19 8:31 ` David Hildenbrand [this message]
2025-02-26 19:54 ` Alex Williamson
2025-02-26 20:05 ` David Hildenbrand
2025-02-19 2:37 ` [PATCH v2 0/6] vfio: Improve DMA mapping performance for huge pfnmaps Mitchell Augustin
2025-02-28 16:32 ` Alex Williamson
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=3d1315ab-ba94-46c2-8dbf-ef26454f7007@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=jgg@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mitchell.augustin@canonical.com \
--cc=peterx@redhat.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