[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADrL8HV+v9NgJyX87Dd6XMYPqe1mUNqxYxJX520Xr2x9SktdZw@mail.gmail.com>
Date: Tue, 27 Dec 2022 11:39:50 -0500
From: James Houghton <jthoughton@...gle.com>
To: Peter Xu <peterx@...hat.com>
Cc: Mike Kravetz <mike.kravetz@...cle.com>,
Muchun Song <songmuchun@...edance.com>,
David Hildenbrand <david@...hat.com>,
David Rientjes <rientjes@...gle.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Mina Almasry <almasrymina@...gle.com>,
"Zach O'Keefe" <zokeefe@...gle.com>,
Manish Mishra <manish.mishra@...anix.com>,
Naoya Horiguchi <naoya.horiguchi@....com>,
"Dr . David Alan Gilbert" <dgilbert@...hat.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Vlastimil Babka <vbabka@...e.cz>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Yang Shi <shy828301@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2 35/47] userfaultfd: require UFFD_FEATURE_EXACT_ADDRESS
when using HugeTLB HGM
On Thu, Dec 22, 2022 at 4:47 PM Peter Xu <peterx@...hat.com> wrote:
>
> On Fri, Oct 21, 2022 at 04:36:51PM +0000, James Houghton wrote:
> > @@ -1990,6 +1990,17 @@ static int userfaultfd_api(struct userfaultfd_ctx *ctx,
> > ~(UFFD_FEATURE_MINOR_HUGETLBFS | UFFD_FEATURE_MINOR_SHMEM);
> > #ifndef CONFIG_HUGETLB_HIGH_GRANULARITY_MAPPING
> > uffdio_api.features &= ~UFFD_FEATURE_MINOR_HUGETLBFS_HGM;
> > +#else
> > +
> > + ret = -EINVAL;
> > + if ((uffdio_api.features & UFFD_FEATURE_MINOR_HUGETLBFS_HGM) &&
> > + !(uffdio_api.features & UFFD_FEATURE_EXACT_ADDRESS))
>
> This check needs to be done upon "features" or "ctx_features", rather than
> "uffdio_api.features". The latter is the one we'll report to the user only.
Ack, thanks Peter. I'm going to drop this patch given the API change
(switching to MADV_SPLIT).
- James
Powered by blists - more mailing lists