linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Yu Zhao <yuzhao@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Link Lin <linkl@google.com>
Subject: Re: [PATCH mm-unstable v1] mm/page_alloc: try not to overestimate free highatomic
Date: Mon, 21 Oct 2024 19:25:55 +0200	[thread overview]
Message-ID: <ZxaOo59ZwXoCduhG@tiehlicka> (raw)
In-Reply-To: <CAOUHufZ1fBvj0DgxtuLvwMAu-qx=jFAqM5RaooXzuYqCCTK1QA@mail.gmail.com>

On Mon 21-10-24 11:10:50, Yu Zhao wrote:
> On Mon, Oct 21, 2024 at 2:13 AM Michal Hocko <mhocko@suse.com> wrote:
> >
> > On Sat 19-10-24 23:13:15, Yu Zhao wrote:
> > > OOM kills due to vastly overestimated free highatomic reserves were
> > > observed:
> > >
> > >   ... invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0 ...
> > >   Node 0 Normal free:1482936kB boost:0kB min:410416kB low:739404kB high:1068392kB reserved_highatomic:1073152KB ...
> > >   Node 0 Normal: 1292*4kB (ME) 1920*8kB (E) 383*16kB (UE) 220*32kB (ME) 340*64kB (E) 2155*128kB (UE) 3243*256kB (UE) 615*512kB (U) 1*1024kB (M) 0*2048kB 0*4096kB = 1477408kB
> > >
> > > The second line above shows that the OOM kill was due to the following
> > > condition:
> > >
> > >   free (1482936kB) - reserved_highatomic (1073152kB) = 409784KB < min (410416kB)
> > >
> > > And the third line shows there were no free pages in any
> > > MIGRATE_HIGHATOMIC pageblocks, which otherwise would show up as type
> > > 'H'. Therefore __zone_watermark_unusable_free() overestimated free
> > > highatomic reserves. IOW, it underestimated the usable free memory by
> > > over 1GB, which resulted in the unnecessary OOM kill.
> >
> > Why doesn't unreserve_highatomic_pageblock deal with this situation?
> 
> The current behavior of unreserve_highatomic_pageblock() seems WAI to
> me: it unreserves highatomic pageblocks that contain *free* pages so
> that those pages can become usable to others. There is nothing to
> unreserve when they have no free pages.

I do not follow. How can you have reserved highatomic pages of that size
without having page blocks with free memory. In other words is this an
accounting problem or reserves problem? This is not really clear from
your description.

-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2024-10-21 17:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-20  5:13 Yu Zhao
2024-10-21  8:13 ` Michal Hocko
2024-10-21 17:10   ` Yu Zhao
2024-10-21 17:25     ` Michal Hocko [this message]
2024-10-21 17:47       ` Yu Zhao
2024-10-22 10:53       ` Vlastimil Babka
2024-10-23  6:36         ` Yu Zhao
2024-10-23  7:34           ` Vlastimil Babka
2024-10-23  9:25             ` Matt Fleming
2024-10-23  9:44               ` Vlastimil Babka
2024-10-24  4:35             ` Yu Zhao
2024-10-24  8:16               ` Vlastimil Babka
2024-10-24 21:15                 ` Yu Zhao

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=ZxaOo59ZwXoCduhG@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=linkl@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=yuzhao@google.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