[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADrL8HXndK9uzHN9PFwbBy24ZN5Zg_GCKbo3To2Yn-1nU0hv=Q@mail.gmail.com>
Date: Wed, 30 Nov 2022 18:29:04 -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 06/47] hugetlb: extend vma lock for shared vmas
On Wed, Nov 30, 2022 at 4:01 PM Peter Xu <peterx@...hat.com> wrote:
>
> On Fri, Oct 21, 2022 at 04:36:22PM +0000, James Houghton wrote:
> > This allows us to add more data into the shared structure, which we will
> > use to store whether or not HGM is enabled for this VMA or not, as HGM
> > is only available for shared mappings.
> >
> > It may be better to include HGM as a VMA flag instead of extending the
> > VMA lock structure.
> >
> > Signed-off-by: James Houghton <jthoughton@...gle.com>
> > ---
> > include/linux/hugetlb.h | 4 +++
> > mm/hugetlb.c | 65 +++++++++++++++++++++--------------------
> > 2 files changed, 37 insertions(+), 32 deletions(-)
> >
> > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> > index a899bc76d677..534958499ac4 100644
> > --- a/include/linux/hugetlb.h
> > +++ b/include/linux/hugetlb.h
> > @@ -121,6 +121,10 @@ struct hugetlb_vma_lock {
> > struct vm_area_struct *vma;
> > };
> >
> > +struct hugetlb_shared_vma_data {
> > + struct hugetlb_vma_lock vma_lock;
> > +};
>
> How about add a comment above hugetlb_vma_lock showing how it should be
> used correctly? We lacked documents on the lock for pmd sharing
> protections, now if to reuse the same lock for HGM pgtables I think some
> doc will definitely help.
>
> To summarize, I think so far it means:
>
> - Read lock needed when one wants to stablize VM_SHARED pgtables (covers
> both pmd shared pgtables or hgm low-level pgtables)
>
> - Write lock needed when one wants to release VM_SHARED pgtable pages
> (covers both pmd unshare or releasing hgm low-level pgtables)
>
> Or something like that.
Will do. I'll make this change together with the rmap comment update
("rmap: update hugetlb lock comment for HGM").
- James
>
> --
> Peter Xu
>
Powered by blists - more mailing lists