linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lokesh Gidra <lokeshgidra@google.com>
To: David Hildenbrand <david@redhat.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Harry Yoo <harry.yoo@oracle.com>, Zi Yan <ziy@nvidia.com>,
	Barry Song <21cnbao@gmail.com>,
	 "open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	Peter Xu <peterx@redhat.com>,
	 Suren Baghdasaryan <surenb@google.com>,
	Kalesh Singh <kaleshsingh@google.com>,
	 android-mm <android-mm@google.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	 Jann Horn <jannh@google.com>, Rik van Riel <riel@surriel.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	 "Liam R. Howlett" <Liam.Howlett@oracle.com>
Subject: Re: [DISCUSSION] Unconditionally lock folios when calling rmap_walk()
Date: Sun, 7 Sep 2025 21:56:26 -0700	[thread overview]
Message-ID: <CA+EESO4iBZu0qcqWrSP166OYRp1Mqr2i0Z5ei1sjd1g6+bT6Ow@mail.gmail.com> (raw)
In-Reply-To: <CA+EESO42EqQps7C7P1HfMJ07ioRnkktKGXO42VU0fHT_1xvC8A@mail.gmail.com>

On Tue, Sep 2, 2025 at 12:04 PM Lokesh Gidra <lokeshgidra@google.com> wrote:
>
> On Tue, Sep 2, 2025 at 12:01 PM David Hildenbrand <david@redhat.com> wrote:
> >
> > On 02.09.25 20:59, Lokesh Gidra wrote:
> > > On Fri, Aug 29, 2025 at 2:04 AM Lorenzo Stoakes
> > > <lorenzo.stoakes@oracle.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
> >


  reply	other threads:[~2025-09-08  4:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22 17:29 Lokesh Gidra
2025-08-22 17:44 ` Matthew Wilcox
2025-08-22 18:08   ` Lorenzo Stoakes
2025-08-24  4:18 ` Lokesh Gidra
2025-08-24  5:31   ` Harry Yoo
2025-08-24  6:45     ` Lokesh Gidra
2025-08-25 10:52       ` Harry Yoo
2025-08-28 11:32         ` Lorenzo Stoakes
2025-08-25 15:19 ` David Hildenbrand
2025-08-25 18:46   ` Lokesh Gidra
2025-08-28 12:04   ` Lorenzo Stoakes
2025-08-29  0:23     ` Lokesh Gidra
2025-08-29  8:42       ` David Hildenbrand
2025-08-29  9:04         ` Lorenzo Stoakes
2025-09-02 18:59           ` Lokesh Gidra
2025-09-02 19:01             ` David Hildenbrand
2025-09-02 19:04               ` Lokesh Gidra
2025-09-08  4:56                 ` Lokesh Gidra [this message]
2025-08-29  9:01       ` Lorenzo Stoakes
2025-08-26 15:52 ` Lorenzo Stoakes
2025-08-26 22:23   ` Lokesh Gidra
2025-08-28 11:31     ` Lorenzo Stoakes

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=CA+EESO4iBZu0qcqWrSP166OYRp1Mqr2i0Z5ei1sjd1g6+bT6Ow@mail.gmail.com \
    --to=lokeshgidra@google.com \
    --cc=21cnbao@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=android-mm@google.com \
    --cc=david@redhat.com \
    --cc=harry.yoo@oracle.com \
    --cc=jannh@google.com \
    --cc=kaleshsingh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=peterx@redhat.com \
    --cc=riel@surriel.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=ziy@nvidia.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