From: Vlastimil Babka <vbabka@suse.cz>
To: Matt Fleming <mfleming@cloudflare.com>
Cc: Yu Zhao <yuzhao@google.com>, Michal Hocko <mhocko@suse.com>,
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>,
Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH mm-unstable v1] mm/page_alloc: try not to overestimate free highatomic
Date: Wed, 23 Oct 2024 11:44:24 +0200 [thread overview]
Message-ID: <d2b2409c-30ac-4c28-9ce7-f5e887f5d480@suse.cz> (raw)
In-Reply-To: <CAGis_TUHyH8mM4q+pWJH+LfYchQkjL6Pap4sNfLA=HRqg50KAQ@mail.gmail.com>
On 10/23/24 11:25, Matt Fleming wrote:
> On Wed, Oct 23, 2024 at 8:35 AM Vlastimil Babka <vbabka@suse.cz> wrote:
>>
>> I thought the alloc demand is only blocked on the pessimistic watermark
>> calculation. Usable free pages exist, but the allocation is not allowed to
>> use them.
>
> I'm confused -- I thought the problem was the inverse of your
> statement: the allocation is attempted because
> __zone_watermark_unusable_free() claims the highatomic pages are free
> but they're not?
AFAICS the fix is about GFP_HIGHUSER_MOVABLE allocation, so not eligible for
highatomic reserves. Thus the watermark check in
__zone_watermark_unusable_free() will add z->nr_reserved_highatomic as
unusable_free, which is then subtracted from actual NR_FREE_PAGES. But since
there are little or no actual free highatomic pages within the
NR_FREE_PAGES, we're subtracting more than we should and this makes the
watermark check very pessimistic and likely to fail. So the allocation is
denied even if it would find many non-highatomic pages to allocate, and
above the watermark.
The problem you describe would apply to a highatomic allocation. Which would
then try to reserve more, but maybe conclude we already have too many
reserved, and not reserve anything. But highatomic pageblocks that are
already full don't really contribute to that reserve anymore, so it would be
better to stop marking and counting them as highatomic, and instead allow
new ones to be reserved. So I think both kinds of allocations (highatomic or
not) are losing here due to full highatomic pageblocks.
next prev parent reply other threads:[~2024-10-23 9:44 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
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 [this message]
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=d2b2409c-30ac-4c28-9ce7-f5e887f5d480@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=linkl@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mfleming@cloudflare.com \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--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