File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -785,13 +785,27 @@ fn create_numa_nodes(
785
785
}
786
786
}
787
787
788
+ let cpu_pattern = numa_path. join ( "cpu[0-9]*" ) ;
789
+ let cpu_paths = glob ( cpu_pattern. to_string_lossy ( ) . as_ref ( ) ) ?;
788
790
let big_little = has_big_little ( ) . unwrap_or ( false ) ;
789
791
let capacity_src = cpu_capacity_source ( ) ;
790
792
let avg_cpu_freq = avg_cpu_freq ( ) ;
791
- let cpu_ids = read_cpu_ids ( ) ?;
792
- for cpu_id in cpu_ids. iter ( ) {
793
+ let mut cpu_ids = vec ! [ ] ;
794
+ for cpu_path in cpu_paths. filter_map ( Result :: ok) {
795
+ let cpu_str = cpu_path. to_str ( ) . unwrap ( ) . trim ( ) ;
796
+ let cpu_id = match sscanf ! ( cpu_str, "/sys/devices/system/node/node{usize}/cpu{usize}" ) {
797
+ Ok ( ( _, val) ) => val,
798
+ Err ( _) => {
799
+ bail ! ( "Failed to parse cpu ID {}" , cpu_str) ;
800
+ }
801
+ } ;
802
+ cpu_ids. push ( cpu_id) ;
803
+ }
804
+ cpu_ids. sort ( ) ;
805
+
806
+ for cpu_id in cpu_ids {
793
807
create_insert_cpu (
794
- * cpu_id,
808
+ cpu_id,
795
809
& mut node,
796
810
online_mask,
797
811
topo_ctx,
You can’t perform that action at this time.
0 commit comments