ACPI: add a boot parameter to disable parsing CFMWS during NUMA init
Subsystems (2)
PATCH 1/1 ACPI: add a boot parameter to disable parsing CFMWS during NUMA init
For the machine Intel(R) Xeon(R) 6746E that supports CXL memory, the possible node is 20 (0-19). However, only two numa nodes (0-1) have memory and the rest (2-19) nodes detected by CEDT is memoryless.
The problems is that when creating many pods, the shrinker map size need to be expanded for all memory cgroups in expand_shrinker_info(). If the number of possibles nodes is too large, the holding time of shrinker lock grows significantly.
In this case, there is no CXL memory inserted in the machine, those memoryless nodes are useless for us, so there is no need set them to 'numa_nodes_parsed'. After disabling parsing CFMWS, the pod creation time is reduced from over 10 minutes to approximately 150 seconds in our intertel test.
--- drivers/acpi/numa/srat.c | 29 ++++++++++++++++++++++------- include/acpi/acpi_numa.h | 6 ++++++ 2 files changed, 28 insertions(+), 7 deletions(-)
drivers/acpi/numa/srat.c +22 -7
@@ -31,6 +31,7 @@ static int node_to_pxm_map[MAX_NUMNODES]unsigned char acpi_srat_revision__initdata ;static int acpi_numa__initdata ; +static int cfmws_numa__initdata ;static int last_real_pxm;
@@ -39,6 +40,12 @@ void __init disable_srat(void) acpi_numa =-1 ; } +void __init disable_cfmws (void ) +{ + cfmws_numa =-1 ; +} + +int pxm_to_node (int pxm) {if (pxm <0 || pxm >=MAX_PXM_DOMAINS || numa_off)
@@ -313,6 +320,12 @@ int __init srat_disabled(void)return acpi_numa <0 ; } +int __init cfmws_disabled (void ) +{ +return cfmws_numa <0 ; +} + +__weak int __init numa_fill_memblks (u64 start,u64 end) {return NUMA_NO_MEMBLK ;
@@ -648,14 +661,16 @@ int __init acpi_numa_init(void)*/ /* fake_pxm is the next unused PXM value after SRAT parsing */ -for (i =0 , fake_pxm =-1 ; i <MAX_NUMNODES ; i++) { -if (node_to_pxm_map[i] > fake_pxm) - fake_pxm = node_to_pxm_map[i]; +if (!cfmws_disabled ()) { +for (i =0 , fake_pxm =-1 ; i <MAX_NUMNODES ; i++) { +if (node_to_pxm_map[i] > fake_pxm) + fake_pxm = node_to_pxm_map[i]; + } + last_real_pxm = fake_pxm; + fake_pxm++; +acpi_table_parse_cedt (ACPI_CEDT_TYPE_CFMWS , acpi_parse_cfmws, + &fake_pxm); } - last_real_pxm = fake_pxm; - fake_pxm++; -acpi_table_parse_cedt (ACPI_CEDT_TYPE_CFMWS , acpi_parse_cfmws, - &fake_pxm);if (cnt <0 )return cnt;
include/acpi/acpi_numa.h +6 -0
@@ -21,6 +21,7 @@ extern int fix_pxm_node_maps(int max_nid);extern void bad_srat (void );extern int srat_disabled (void ); +extern void disable_cfmws (void );#else /* CONFIG_ACPI_NUMA */ static inline int fix_pxm_node_maps (int max_nid)
@@ -30,6 +31,11 @@ static inline int fix_pxm_node_maps(int max_nid)static inline void disable_srat (void ) { } + +static inline void disable_cfmws (void ) +{ +} +static inline int pxm_to_node (int pxm) {return 0 ;
Signature · 1 line
2.43.0
Quoted 97 lines · Haifeng Xu
For the machine Intel(R) Xeon(R) 6746E that supports CXL memory, the possible node is 20 (0-19). However, only two numa nodes (0-1) have memory and the rest (2-19) nodes detected by CEDT is memoryless.
The problems is that when creating many pods, the shrinker map size need to be expanded for all memory cgroups in
expand_shrinker_info(). If the number of possibles nodes is too large, the holding time of shrinker lock grows significantly.In this case, there is no CXL memory inserted in the machine, those memoryless nodes are useless for us, so there is no need set them to '
numa_nodes_parsed'. After disabling parsing CFMWS, the pod creation time is reduced from over 10 minutes to approximately 150 seconds in our intertel test.Signed-off-by Haifeng Xu <[email protected]>--- drivers/acpi/numa/srat.c | 29 ++++++++++++++++++++++------- include/acpi/acpi_numa.h | 6 ++++++ 2 files changed, 28 insertions(+), 7 deletions(-)drivers/acpi/numa/srat.c +22
-7@@ -31,6 +31,7 @@ static int node_to_pxm_map[MAX_NUMNODES]unsigned char acpi_srat_revision__initdata ;static int acpi_numa__initdata ; +static int cfmws_numa__initdata ;static int last_real_pxm;@@ -39,6 +40,12 @@ void __init disable_srat(void) acpi_numa =-1 ; } +void __init disable_cfmws (void ) +{ + cfmws_numa =-1 ; +} + +int pxm_to_node (int pxm) {if (pxm <0 || pxm >=MAX_PXM_DOMAINS || numa_off)@@ -313,6 +320,12 @@ int __init srat_disabled(void)return acpi_numa <0 ; } +int __init cfmws_disabled (void ) +{ +return cfmws_numa <0 ; +} + +__weak int __init numa_fill_memblks (u64 start,u64 end) {return NUMA_NO_MEMBLK ;@@ -648,14 +661,16 @@ int __init acpi_numa_init(void)*/ /* fake_pxm is the next unused PXM value after SRAT parsing */ -for (i =0 , fake_pxm =-1 ; i <MAX_NUMNODES ; i++) { -if (node_to_pxm_map[i] > fake_pxm) - fake_pxm = node_to_pxm_map[i]; +if (!cfmws_disabled ()) { +for (i =0 , fake_pxm =-1 ; i <MAX_NUMNODES ; i++) { +if (node_to_pxm_map[i] > fake_pxm) + fake_pxm = node_to_pxm_map[i]; + } + last_real_pxm = fake_pxm; + fake_pxm++; +acpi_table_parse_cedt (ACPI_CEDT_TYPE_CFMWS , acpi_parse_cfmws, + &fake_pxm); } - last_real_pxm = fake_pxm; - fake_pxm++; -acpi_table_parse_cedt (ACPI_CEDT_TYPE_CFMWS , acpi_parse_cfmws, - &fake_pxm);if (cnt <0 )return cnt;include/acpi/acpi_numa.h +1
-0@@ -21,6 +21,7 @@ extern int fix_pxm_node_maps(int max_nid);extern void bad_srat (void );extern int srat_disabled (void ); +extern void disable_cfmws (void );#else /* CONFIG_ACPI_NUMA */ static inline int fix_pxm_node_maps (int max_nid)@@ -30,6 +31,11 @@ static inline int fix_pxm_node_maps(int max_nid)static inline void disable_srat (void )
include/acpi/acpi_numa.h static inline int fix_pxm_node_maps(int max_nid) · line 41
Quoted 10 lines
include/acpi/acpi_numa.h +5
-0{ } + +static inline void disable_cfmws (void ) +{ +} +static inline int pxm_to_node (int pxm) {return 0 ;
Sorry, This patch is deprecated. I'll send a new one.