[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+EESO4iBZu0qcqWrSP166OYRp1Mqr2i0Z5ei1sjd1g6+bT6Ow@mail.gmail.com>
Date: Sun, 7 Sep 2025 21:56:26 -0700
From: Lokesh Gidra <lokeshgidra@...gle.com>
To: David Hildenbrand <david@...hat.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Andrew Morton <akpm@...ux-foundation.org>,
Harry Yoo <harry.yoo@...cle.com>, Zi Yan <ziy@...dia.com>, Barry Song <21cnbao@...il.com>,
"open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>, Peter Xu <peterx@...hat.com>,
Suren Baghdasaryan <surenb@...gle.com>, Kalesh Singh <kaleshsingh@...gle.com>,
android-mm <android-mm@...gle.com>, linux-kernel <linux-kernel@...r.kernel.org>,
Jann Horn <jannh@...gle.com>, Rik van Riel <riel@...riel.com>, Vlastimil Babka <vbabka@...e.cz>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>
Subject: Re: [DISCUSSION] Unconditionally lock folios when calling rmap_walk()
On Tue, Sep 2, 2025 at 12:04 PM Lokesh Gidra <lokeshgidra@...gle.com> wrote:
>
> On Tue, Sep 2, 2025 at 12:01 PM David Hildenbrand <david@...hat.com> wrote:
> >
> > On 02.09.25 20:59, Lokesh Gidra wrote:
> > > On Fri, Aug 29, 2025 at 2:04 AM Lorenzo Stoakes
> > > <lorenzo.stoakes@...cle.com> wrote:
> > >>
> > >> On Fri, Aug 29, 2025 at 10:42:45AM +0200, David Hildenbrand wrote:
> > >>>>>
> > >>>>> I do wonder if we can identify this case and handle things differently.
> > >>>>>
> > >>>>> Perhaps even saying 'try and get the rmap lock, but if there's "too much"
> > >>>>> contention, grab the folio lock.
> > >>>>
> > >>>> Can you please elaborate what you mean? Where do you mean we can
> > >>>> possibly do something like this?
> > >>>>
> > >>>> UFFD move only works on PageAnonExclusive folios. So, would it help
> > >>>> (in terms of avoiding contention) if we were to change the condition:
> > >>>
> > >>> I think we shouldn't be using PAE here. Once could consider using
> > >>> folio_maybe_mapped_shared(), and assume contention on the folio lock if it
> > >>> is maybe mapped shared.
> > >>
> > >> Interesting!
> > >>
> > >>>
> > >>> But the real question is with whom we would be contending for the folio
> > >>> lock.
> > >>>
> > >>> Is it really other processes mapping that folio? I'm not so sure.
> > >>
> > >> Yeah, I might go off and do some research myself on this, actually. Nail down
> > >> wehre this might actually happen.
> > >>
> > >> Generally I'm softening on this and maybe we're good with the proposed change.
> > >>
> > >> But still want to be super careful here... :)
> > >>
> > > Anxiously waiting for your assessment. Fingers crossed :)
> >
> > I'd suggest you prepare an RFC patch where you neatly summarize all we
> > learned so far. :)
> >
Sent the patches:
https://lore.kernel.org/all/20250908044950.311548-1-lokeshgidra@google.com/
> Sounds good. Will do. Thanks.
> > --
> > Cheers
> >
> > David / dhildenb
> >
Powered by blists - more mailing lists