From: Vlastimil Babka <vbabka@suse.cz>
To: Brendan Jackman <jackmanb@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@techsingularity.net>,
Michal Hocko <mhocko@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Yosry Ahmed <yosry.ahmed@linux.dev>
Subject: Re: [PATCH v4 2/2] mm/page_alloc: Clarify should_claim_block() commentary
Date: Fri, 28 Feb 2025 10:59:20 +0100 [thread overview]
Message-ID: <13614e0a-4985-42a1-87b2-a57237437a08@suse.cz> (raw)
In-Reply-To: <20250228-clarify-steal-v4-2-cb2ef1a4e610@google.com>
On 2/28/25 10:52, Brendan Jackman wrote:
> There's lots of text here but it's a little hard to follow, this is an
> attempt to break it up and align its structure more closely with the
> code.
>
> Reword the top-level function comment to just explain what question the
> function answers from the point of view of the caller.
>
> Break up the internal logic into different sections that can have their
> own commentary describing why that part of the rationale is present.
>
> Note the page_group_by_mobility_disabled logic is not explained in the
> commentary, that is outside the scope of this patch...
>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
> + /*
> + * Unmovable/reclaimable allocations would cause permanent
> + * fragmentations if they fell back to allocating from a movable block
> + * (polluting it), so we try to claim the whole block regardless of the
> + * allocation size. Later movable allocations can always steal from this
> + * block, which is less problematic.
> + */
> + if (start_mt == MIGRATE_RECLAIMABLE || start_mt == MIGRATE_UNMOVABLE)
> + return true;
> +
> + if (page_group_by_mobility_disabled)
> + return true;
> +
> + /*
> + * Movable pages won't cause permanent fragmentation, so when you alloc
s/you/we/ for consistency? I think Andrew can amend locally to avoid resend.
Thanks.
> + * small pages, we just need to temporarily steal unmovable or
> + * reclaimable pages that are closest to the request size. After a
> + * while, memory compaction may occur to form large contiguous pages,
> + * and the next movable allocation may not need to steal.
> + */
> return false;
> }
>
>
prev parent reply other threads:[~2025-02-28 9:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 9:52 [PATCH v4 0/2] mm/page_alloc: Some clarifications for migratetype fallback Brendan Jackman
2025-02-28 9:52 ` [PATCH v4 1/2] mm/page_alloc: Clarify terminology in migratetype fallback code Brendan Jackman
2025-02-28 9:52 ` [PATCH v4 2/2] mm/page_alloc: Clarify should_claim_block() commentary Brendan Jackman
2025-02-28 9:59 ` Vlastimil Babka [this message]
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=13614e0a-4985-42a1-87b2-a57237437a08@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=yosry.ahmed@linux.dev \
/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