From: Christoph Hellwig <hch@infradead.org>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: dri-devel@lists.freedesktop.org, linux-mm@kvack.org,
David Hildenbrand <david@redhat.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Mike Kravetz <mike.kravetz@oracle.com>,
Hugh Dickins <hughd@google.com>, Peter Xu <peterx@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Dongwon Kim <dongwon.kim@intel.com>,
Junxiao Chang <junxiao.chang@intel.com>
Subject: Re: [PATCH v6 2/5] udmabuf: Add back support for mapping hugetlb pages (v5)
Date: Wed, 6 Dec 2023 01:16:23 -0800 [thread overview]
Message-ID: <ZXA756cPxHETXJJL@infradead.org> (raw)
In-Reply-To: <20231205053509.2342169-3-vivek.kasireddy@intel.com>
> + if (ubuf->subpgoff) {
> + pfn += ubuf->subpgoff[pgoff] >> PAGE_SHIFT;
> + }
No need for the braces here..
> @@ -253,16 +271,59 @@ static long udmabuf_create(struct miscdevice *device,
> goto err;
> pgoff = list[i].offset >> PAGE_SHIFT;
> pgcnt = list[i].size >> PAGE_SHIFT;
> + if (is_file_hugepages(memfd)) {
> + if (!ubuf->subpgoff) {
> + ubuf->subpgoff = kmalloc_array(ubuf->pagecount,
> + sizeof(*ubuf->subpgoff),
Overly long line here.
Given how much code there is in the main loop here this almost screams
for splitting that into a helper anyay.
And then the body of the pgidx loop below which is compeltely different
for hugetlb vs not ask for another helper each for the loop body
variants.
next prev parent reply other threads:[~2023-12-06 9:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 5:35 [PATCH v6 0/5] mm/gup: Introduce memfd_pin_user_pages() for pinning memfd pages (v6) Vivek Kasireddy
2023-12-05 5:35 ` [PATCH v6 1/5] udmabuf: Use vmf_insert_pfn and VM_PFNMAP for handling mmap Vivek Kasireddy
2023-12-05 5:35 ` [PATCH v6 2/5] udmabuf: Add back support for mapping hugetlb pages (v5) Vivek Kasireddy
2023-12-06 9:16 ` Christoph Hellwig [this message]
2023-12-05 5:35 ` [PATCH v6 3/5] mm/gup: Introduce memfd_pin_user_pages() for pinning memfd pages (v6) Vivek Kasireddy
2023-12-06 9:18 ` Christoph Hellwig
2023-12-07 5:06 ` Kasireddy, Vivek
2023-12-06 11:19 ` David Hildenbrand
2023-12-07 5:09 ` Kasireddy, Vivek
2023-12-07 9:44 ` David Hildenbrand
2023-12-07 13:05 ` Jason Gunthorpe
2023-12-07 13:35 ` David Hildenbrand
2023-12-08 7:57 ` Kasireddy, Vivek
2023-12-08 9:53 ` David Hildenbrand
2023-12-05 5:35 ` [PATCH v6 4/5] udmabuf: Pin the pages using memfd_pin_user_pages() API (v4) Vivek Kasireddy
2023-12-05 5:35 ` [PATCH v6 5/5] selftests/dma-buf/udmabuf: Add tests to verify data after page migration Vivek Kasireddy
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=ZXA756cPxHETXJJL@infradead.org \
--to=hch@infradead.org \
--cc=daniel.vetter@ffwll.ch \
--cc=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