Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <richard.weiyang@gmail.com>
Link: https://lore.kernel.org/r/20240525023040.13509-3-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>

authored by

Wei Yang and committed by
Mike Rapoport (IBM)
922306a2 93bbbcb1

+8 -6
+8 -6
mm/mm_init.c
··· 676 676 677 677 if (early_page_ext_enabled()) 678 678 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 + 679 687 /* 680 688 * prev_end_pfn static that contains the end of previous zone 681 689 * No need to protect because called very early in boot before smp_init. ··· 693 685 nr_initialised = 0; 694 686 } 695 687 696 - /* Always populate low zones for address-constrained allocations */ 697 - if (end_pfn < pgdat_end_pfn(NODE_DATA(nid))) 698 - return false; 699 - 700 - if (NODE_DATA(nid)->first_deferred_pfn != ULONG_MAX) 701 - return true; 702 688 /* 703 689 * We start only with one section of pages, more pages are added as 704 690 * needed until the rest of deferred pages are initialized.