Skip to content

Commit 922306a

Browse files
RichardWeiYangrppt
authored andcommitted
mm/mm_init.c: move nr_initialised reset down a bit
We don't need to count nr_initialised in two cases: * for low zones that are always populated * after first_deferred_pfn is detected Let's move the nr_initialised reset down a bit to reduce some comparison of prev_end_pfn and end_pfn. Signed-off-by: Wei Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport (IBM) <[email protected]>
1 parent 93bbbcb commit 922306a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

mm/mm_init.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,14 @@ defer_init(int nid, unsigned long pfn, unsigned long end_pfn)
676676

677677
if (early_page_ext_enabled())
678678
return false;
679+
680+
/* Always populate low zones for address-constrained allocations */
681+
if (end_pfn < pgdat_end_pfn(NODE_DATA(nid)))
682+
return false;
683+
684+
if (NODE_DATA(nid)->first_deferred_pfn != ULONG_MAX)
685+
return true;
686+
679687
/*
680688
* prev_end_pfn static that contains the end of previous zone
681689
* No need to protect because called very early in boot before smp_init.
@@ -685,12 +693,6 @@ defer_init(int nid, unsigned long pfn, unsigned long end_pfn)
685693
nr_initialised = 0;
686694
}
687695

688-
/* Always populate low zones for address-constrained allocations */
689-
if (end_pfn < pgdat_end_pfn(NODE_DATA(nid)))
690-
return false;
691-
692-
if (NODE_DATA(nid)->first_deferred_pfn != ULONG_MAX)
693-
return true;
694696
/*
695697
* We start only with one section of pages, more pages are added as
696698
* needed until the rest of deferred pages are initialized.

0 commit comments

Comments
 (0)