From: David Hildenbrand <david@redhat.com>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>,
dri-devel@lists.freedesktop.org, linux-mm@kvack.org,
Mike Kravetz <mike.kravetz@oracle.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>,
Junxiao Chang <junxiao.chang@intel.com>,
Hugh Dickins <hughd@google.com>, Peter Xu <peterx@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>
Subject: Re: [PATCH v2 2/2] udmabuf: Add back support for mapping hugetlb pages (v2)
Date: Tue, 18 Jul 2023 20:05:02 +0200 [thread overview]
Message-ID: <2556f0dd-d951-c21f-0e2e-7f2bb8d9fab3@redhat.com> (raw)
In-Reply-To: <20230718082605.1570740-3-vivek.kasireddy@intel.com>
On 18.07.23 10:26, Vivek Kasireddy wrote:
> A user or admin can configure a VMM (Qemu) Guest's memory to be
> backed by hugetlb pages for various reasons. However, a Guest OS
> would still allocate (and pin) buffers that are backed by regular
> 4k sized pages. In order to map these buffers and create dma-bufs
> for them on the Host, we first need to find the hugetlb pages where
> the buffer allocations are located and then determine the offsets
> of individual chunks (within those pages) and use this information
> to eventually populate a scatterlist.
>
> Testcase: default_hugepagesz=2M hugepagesz=2M hugepages=2500 options
> were passed to the Host kernel and Qemu was launched with these
> relevant options: qemu-system-x86_64 -m 4096m....
> -device virtio-gpu-pci,max_outputs=1,blob=true,xres=1920,yres=1080
> -display gtk,gl=on
> -object memory-backend-memfd,hugetlb=on,id=mem1,size=4096M
> -machine memory-backend=mem1
>
> Replacing -display gtk,gl=on with -display gtk,gl=off above would
> exercise the mmap handler.
>
> v2: Updated get_sg_table() to manually populate the scatterlist for
> both huge page and non-huge-page cases.
>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Dongwon Kim <dongwon.kim@intel.com>
> Cc: Junxiao Chang <junxiao.chang@intel.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
> drivers/dma-buf/udmabuf.c | 84 +++++++++++++++++++++++++++++++++------
> 1 file changed, 71 insertions(+), 13 deletions(-)
LGTM, in general. But I really hope Mike can comment.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2023-07-18 18:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 8:26 [PATCH v2 0/2] udmabuf: Add back support for mapping hugetlb pages (v2) Vivek Kasireddy
2023-07-18 8:26 ` [PATCH v2 1/2] udmabuf: Use vmf_insert_pfn and VM_PFNMAP for handling mmap Vivek Kasireddy
2023-07-18 18:03 ` David Hildenbrand
2023-07-18 8:26 ` [PATCH v2 2/2] udmabuf: Add back support for mapping hugetlb pages (v2) Vivek Kasireddy
2023-07-18 18:05 ` David Hildenbrand [this message]
2023-07-18 23:44 ` Mike Kravetz
2023-07-19 5:42 ` Kasireddy, Vivek
2023-07-27 20:54 ` Peter Xu
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=2556f0dd-d951-c21f-0e2e-7f2bb8d9fab3@redhat.com \
--to=david@redhat.com \
--cc=dongwon.kim@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hughd@google.com \
--cc=jgg@nvidia.com \
--cc=junxiao.chang@intel.com \
--cc=kraxel@redhat.com \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=peterx@redhat.com \
--cc=vivek.kasireddy@intel.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