Re: [PATCH 3/5] mm: page_alloc: defrag_mode
From: Johannes Weiner
Date: Sat Mar 22 2025 - 21:34:20 EST
On Sat, Mar 22, 2025 at 08:58:27PM -0400, Johannes Weiner wrote:
> On Sat, Mar 22, 2025 at 04:05:52PM +0100, Brendan Jackman wrote:
> > On Thu Mar 13, 2025 at 10:05 PM CET, Johannes Weiner wrote:
> > > + /* Reclaim/compaction failed to prevent the fallback */
> > > + if (defrag_mode) {
> > > + alloc_flags &= ALLOC_NOFRAGMENT;
> > > + goto retry;
> > > + }
> >
> > I can't see where ALLOC_NOFRAGMENT gets cleared, is it supposed to be
> > here (i.e. should this be ~ALLOC_NOFRAGMENT)?
Please ignore my previous email, this is actually a much more severe
issue than I thought at first. The screwed up clearing is bad, but
this will also not check the flag before retrying, which means the
thread will retry reclaim/compaction and never reach OOM.
This code has weeks of load testing, with workloads fine-tuned to
*avoid* OOM. A blatant OOM test shows this problem immediately.
A simple fix, but I'll put it through the wringer before sending it.