From: Mike Rapoport <rppt@kernel.org>
To: Sang-Heon Jeon <ekffu200098@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm/mm_init: remove zone_absent_pages_in_node()
Date: Tue, 1 Sep 2026 09:27:54 +0300 [thread overview]
Message-ID: <apZwagtACFXu5vev@kernel.org> (raw)
In-Reply-To: <CABFDxMHQjXUhbkUs_5Ki7Q6ZpQkF6Y-fDCS+LfxERFv09UgOrA@mail.gmail.com>
On Mon, Aug 31, 2026 at 08:30:40PM +0900, Sang-Heon Jeon wrote:
> Hi,
>
> On Mon, Aug 31, 2026 at 4:37 PM Mike Rapoport <rppt@kernel.org> wrote:
> >
> > > zone_absent_pages_in_node() returns 0 when the zone is empty and
> > > otherwise calls __absent_pages_in_range(), which already returns 0 for
> > > an empty range.
> >
> > Right, but it loops over memblock memory for an empty zone to get that 0
>
> Indeed. How about adding an early return in __absent_pages_in_range()
> to avoid unnecessary iteration? I just want to remove the wrapper,
> which never uses its zone_type argument since eb0e5b61369f
> ("mm/mm_init: don't overlap NORMAL and MOVABLE zones with
> kernelcore=mirror")
>
> unsigned long nr_absent = range_end_pfn - range_start_pfn;
> unsigned long start_pfn, end_pfn;
> int i;
>
> + if (!nr_absent)
Yes, just please add a comment:
/* range is empty, nothing to do */
> + return 0;
> +
> for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) {
> start_pfn = clamp(start_pfn, range_start_pfn, range_end_pfn);
> end_pfn = clamp(end_pfn, range_start_pfn, range_end_pfn);
>
> > --
> > Sincerely yours,
> > Mike.
> >
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2026-09-01 6:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 14:41 Sang-Heon Jeon
2026-08-31 7:37 ` Mike Rapoport
2026-08-31 11:30 ` Sang-Heon Jeon
2026-09-01 6:27 ` Mike Rapoport [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=apZwagtACFXu5vev@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ekffu200098@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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
all inboxes | Powered by JetHome®