mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
mm/hugetlb: use hugetlb_vmemmap_optimizable() in boolean contexts
The two boot-time sites in hugetlb_hstate_alloc_pages_onenode() and hugetlb_pages_alloc_boot_node() only need to know whether HVO is applicable, not the exact optimizable size. Switch them from hugetlb_vmemmap_optimizable_size() to hugetlb_vmemmap_optimizable() to make intent explicit. No functional change intended. Link: https://lore.kernel.org/20260824151655.30840-1-kaitao.cheng@linux.dev Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com> Reviewed-by: Muchun Song <muchun.song@linux.dev> Cc: David Hildenbrand <david@kernel.org> Cc: Oscar Salvador <osalvador@suse.de>
This commit is contained in:
parent
d386321046
commit
40965d4997
|
|
@ -3427,7 +3427,7 @@ static void __init hugetlb_hstate_alloc_pages_onenode(struct hstate *h, int nid)
|
|||
folio = only_alloc_fresh_hugetlb_folio(h, gfp_mask, nid,
|
||||
&node_states[N_MEMORY], NULL);
|
||||
if (!folio && !list_empty(&folio_list) &&
|
||||
hugetlb_vmemmap_optimizable_size(h)) {
|
||||
hugetlb_vmemmap_optimizable(h)) {
|
||||
prep_and_add_allocated_folios(h, &folio_list);
|
||||
INIT_LIST_HEAD(&folio_list);
|
||||
folio = only_alloc_fresh_hugetlb_folio(h, gfp_mask, nid,
|
||||
|
|
@ -3496,7 +3496,7 @@ static void __init hugetlb_pages_alloc_boot_node(unsigned long start, unsigned l
|
|||
for (i = 0; i < num; ++i) {
|
||||
struct folio *folio;
|
||||
|
||||
if (hugetlb_vmemmap_optimizable_size(h) &&
|
||||
if (hugetlb_vmemmap_optimizable(h) &&
|
||||
(si_mem_available() == 0) && !list_empty(&folio_list)) {
|
||||
prep_and_add_allocated_folios(h, &folio_list);
|
||||
INIT_LIST_HEAD(&folio_list);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user