File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -391,7 +391,15 @@ static void numa_mapping(void) {
391391 core = 0 ;
392392 for (cpu = 0 ; cpu < common -> num_procs ; cpu ++ ) {
393393 bitmask_idx = CPUELT (cpu );
394+ /*
395+ * When common->avail[i] = 0x5555555555555555UL (indicating that adjacent logical cores share a physical core),
396+ * using it as a mask may overlap with the local_cpu_map function's role, leading to only half of the real physical cores being detected.
397+ */
398+ #ifdef ARCH_LOONGARCH64
399+ if (common -> node_info [node ][bitmask_idx ]) {
400+ #else
394401 if (common -> node_info [node ][bitmask_idx ] & common -> avail [bitmask_idx ] & CPUMASK (cpu )) {
402+ #endif
395403 common -> cpu_info [count ] = WRITE_CORE (core ) | WRITE_NODE (node ) | WRITE_CPU (cpu );
396404 count ++ ;
397405 core ++ ;
@@ -930,8 +938,12 @@ void gotoblas_affinity_init(void) {
930938
931939 if (common -> num_nodes > 1 ) numa_mapping ();
932940
941+ #ifdef ARCH_LOONGARCH64
942+ common -> final_num_procs = common -> num_procs ;
943+ #else
933944 common -> final_num_procs = 0 ;
934945 for (i = 0 ; i < common -> avail_count ; i ++ ) common -> final_num_procs += rcount (common -> avail [i ]) + 1 ; //Make the max cpu number.
946+ #endif
935947
936948 for (cpu = 0 ; cpu < common -> final_num_procs ; cpu ++ ) common -> cpu_use [cpu ] = 0 ;
937949
You can’t perform that action at this time.
0 commit comments