From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Sang-Heon Jeon <ekffu200098@gmail.com>,
David Hildenbrand <david@kernel.org>,
linux-mm@kvack.org
Subject: [PATCH 6/6] mm/hugetlb: remove unnecessary empty range check in hugetlb_bootmem_set_nodes()
Date: Sun, 21 Jun 2026 23:59:16 +0900 [thread overview]
Message-ID: <20260621145919.1453-7-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260621145919.1453-1-ekffu200098@gmail.com>
hugetlb_bootmem_set_nodes() iterates the memory ranges with
for_each_mem_pfn_range() and calls node_set(nid, hugetlb_bootmem_nodes)
only when end_pfn > start_pfn. for_each_mem_pfn_range() never returns an
empty range, so start_pfn < end_pfn always.
Therefore the check is unnecessary, so remove it.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
mm/hugetlb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 571212b80835..d4d4c9df5f51 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4450,8 +4450,7 @@ void __init hugetlb_bootmem_set_nodes(void)
return;
for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
- if (end_pfn > start_pfn)
- node_set(nid, hugetlb_bootmem_nodes);
+ node_set(nid, hugetlb_bootmem_nodes);
}
}
--
2.43.0
next prev parent reply other threads:[~2026-06-21 15:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-21 14:59 [PATCH 0/6] treewide: remove unnecessary invalid range checks in memblock iteration loops Sang-Heon Jeon
2026-06-21 14:59 ` [PATCH 5/6] mm: remove unnecessary empty range check in early_calculate_totalpages() Sang-Heon Jeon
2026-06-21 14:59 ` Sang-Heon Jeon [this message]
2026-06-22 9:07 ` [PATCH 6/6] mm/hugetlb: remove unnecessary empty range check in hugetlb_bootmem_set_nodes() David Hildenbrand (Arm)
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=20260621145919.1453-7-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
/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