From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: zhongjinji <zhongjinji@honor.com>,
mhocko@suse.com, rientjes@google.com, shakeel.butt@linux.dev,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, tglx@linutronix.de,
liulu.liu@honor.com, feng.han@honor.com
Subject: Re: [PATCH v5 2/2] mm/oom_kill: Have the OOM reaper and exit_mmap() traverse the maple tree in opposite order
Date: Tue, 26 Aug 2025 11:21:13 -0400 [thread overview]
Message-ID: <ip7al6pv3nm54raaptrxq3v4t7cpilqgppkezowzn2sfbjax65@qt72zuotrwnw> (raw)
In-Reply-To: <bcabe7cb-d09c-4789-ae39-407b2e0653da@lucifer.local>
* Lorenzo Stoakes <lorenzo.stoakes@oracle.com> [250826 09:50]:
> On Tue, Aug 26, 2025 at 09:37:22AM -0400, Liam R. Howlett wrote:
> > I really don't think this is worth doing. We're avoiding a race between
> > oom and a task unmap - the MMF bits should be used to avoid this race -
> > or at least mitigate it.
>
> Yes for sure, as explored at length in previous discussions this feels like
> we're papering over cracks here.
>
> _However_, I'm sort of ok with a minimalistic fix that solves the proximate
> issue even if it is that, as long as it doesn't cause issues in doing so.
>
> So this is my take on the below and why I'm open to it!
>
> >
> > They are probably both under the read lock, but considering how rare it
> > would be, would a racy flag check be enough - it is hardly critical to
> > get right. Either would reduce the probability.
>
> Zongjinji - I'm stil not sure that you've really indicated _why_ you're
> seeing such a tight and unusual race. Presumably some truly massive number
> of tasks being OOM'd and unmapping but... yeah that seems odd anyway.
>
> But again, if we can safely fix this in a way that doesn't hurt stuff too
> much I'm ok with it (of course, these are famous last words in the kernel
> often...!)
>
> Liam - are you open to a solution on the basis above, or do you feel we
> ought simply to fix the underlying issue here?
At least this is a benign race. I'd think using MMF_ to reduce the race
would achieve the same goal with less risk - which is why I bring it up.
Really, both methods should be low risk, so I'm fine with either way.
But I am interested in hearing how this race is happening enough to
necessitate a fix. Reversing the iterator is a one-spot fix - if this
happens elsewhere then we're out of options. Using the MMF_ flags is
more of a scalable fix, if it achieves the same results.
>
> to me we're at a simple enough implementaiton of this (esp. utilising the
> helper you mention) that probably kthis is fine (like the meme,
> or... hopefully not :)
>
> I will go with your judgment here!
>
> Cheers, Lorenzo
next prev parent reply other threads:[~2025-08-26 15:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 13:38 [PATCH v5 0/2] Do not delay oom reaper when the victim is frozen zhongjinji
2025-08-25 13:38 ` [PATCH v5 1/2] mm/oom_kill: " zhongjinji
2025-08-25 19:41 ` Shakeel Butt
2025-08-26 13:01 ` zhongjinji
2025-08-26 12:43 ` Lorenzo Stoakes
2025-08-27 12:08 ` Michal Hocko
2025-08-27 12:14 ` zhongjinji
2025-08-25 13:38 ` [PATCH v5 2/2] mm/oom_kill: Have the OOM reaper and exit_mmap() traverse the maple tree in opposite order zhongjinji
2025-08-26 12:53 ` Lorenzo Stoakes
2025-08-26 13:37 ` Liam R. Howlett
2025-08-26 13:50 ` Lorenzo Stoakes
2025-08-26 15:21 ` Liam R. Howlett [this message]
2025-08-26 22:26 ` Shakeel Butt
2025-08-27 4:12 ` Liam R. Howlett
2025-08-27 4:25 ` Liam R. Howlett
2025-08-27 9:55 ` zhongjinji
2025-08-27 15:57 ` Suren Baghdasaryan
2025-08-28 0:38 ` Liam R. Howlett
2025-08-29 7:11 ` Michal Hocko
2025-08-29 7:14 ` Michal Hocko
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=ip7al6pv3nm54raaptrxq3v4t7cpilqgppkezowzn2sfbjax65@qt72zuotrwnw \
--to=liam.howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=feng.han@honor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liulu.liu@honor.com \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=shakeel.butt@linux.dev \
--cc=tglx@linutronix.de \
--cc=zhongjinji@honor.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