Commit 2a44683
committed
mm: pass nid to reserve_bootmem_region()
JIRA: https://issues.redhat.com/browse/RHEL-36126
commit 61167ad
Author: Yajun Deng <yajun.deng@linux.dev>
Date: Mon Jun 19 10:34:06 2023 +0800
mm: pass nid to reserve_bootmem_region()
early_pfn_to_nid() is called frequently in init_reserved_page(), it
returns the node id of the PFN. These PFN are probably from the same
memory region, they have the same node id. It's not necessary to call
early_pfn_to_nid() for each PFN.
Pass nid to reserve_bootmem_region() and drop the call to
early_pfn_to_nid() in init_reserved_page(). Also, set nid on all reserved
pages before doing this, as some reserved memory regions may not be set
nid.
The most beneficial function is memmap_init_reserved_pages() if
CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled.
The following data was tested on an x86 machine with 190GB of RAM.
before:
memmap_init_reserved_pages() 67ms
after:
memmap_init_reserved_pages() 20ms
Link: https://lkml.kernel.org/r/20230619023406.424298-1-yajun.deng@linux.dev
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Chanudet <echanude@redhat.com>1 parent ab62de2 commit 2a44683
3 files changed
+40
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2948 | 2948 | | |
2949 | 2949 | | |
2950 | 2950 | | |
2951 | | - | |
| 2951 | + | |
| 2952 | + | |
2952 | 2953 | | |
2953 | 2954 | | |
2954 | 2955 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2092 | 2092 | | |
2093 | 2093 | | |
2094 | 2094 | | |
2095 | | - | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2096 | 2111 | | |
2097 | 2112 | | |
2098 | | - | |
2099 | | - | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
2100 | 2117 | | |
2101 | | - | |
2102 | | - | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
| 2118 | + | |
2108 | 2119 | | |
2109 | 2120 | | |
2110 | 2121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
| 647 | + | |
648 | 648 | | |
649 | | - | |
650 | | - | |
651 | 649 | | |
652 | 650 | | |
653 | 651 | | |
| |||
693 | 691 | | |
694 | 692 | | |
695 | 693 | | |
696 | | - | |
| 694 | + | |
697 | 695 | | |
698 | 696 | | |
699 | | - | |
| 697 | + | |
700 | 698 | | |
701 | | - | |
| 699 | + | |
702 | 700 | | |
703 | 701 | | |
704 | | - | |
705 | 702 | | |
706 | 703 | | |
707 | 704 | | |
| |||
715 | 712 | | |
716 | 713 | | |
717 | 714 | | |
718 | | - | |
| 715 | + | |
719 | 716 | | |
720 | 717 | | |
721 | 718 | | |
| |||
725 | 722 | | |
726 | 723 | | |
727 | 724 | | |
728 | | - | |
| 725 | + | |
729 | 726 | | |
730 | 727 | | |
731 | 728 | | |
| |||
736 | 733 | | |
737 | 734 | | |
738 | 735 | | |
739 | | - | |
| 736 | + | |
| 737 | + | |
740 | 738 | | |
741 | 739 | | |
742 | 740 | | |
| |||
745 | 743 | | |
746 | 744 | | |
747 | 745 | | |
748 | | - | |
| 746 | + | |
749 | 747 | | |
750 | 748 | | |
751 | 749 | | |
| |||
2538 | 2536 | | |
2539 | 2537 | | |
2540 | 2538 | | |
2541 | | - | |
2542 | | - | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
2543 | 2547 | | |
2544 | 2548 | | |
2545 | 2549 | | |
| |||
0 commit comments