diff --git a/scheds/rust/scx_layered/src/main.rs b/scheds/rust/scx_layered/src/main.rs index 4ce0c4c73..50622e85a 100644 --- a/scheds/rust/scx_layered/src/main.rs +++ b/scheds/rust/scx_layered/src/main.rs @@ -1408,26 +1408,24 @@ struct Layer { impl Layer { fn new( + spec: &LayerSpec, idx: usize, cpu_pool: &CpuPool, name: &str, - kind: LayerKind, topo: &Topology, ) -> Result { + let kind = spec.kind.clone(); let mut cpus = bitvec![0; cpu_pool.nr_cpus]; cpus.fill(false); let mut allowed_cpus = bitvec![0; cpu_pool.nr_cpus]; - let mut layer_growth_algo = LayerGrowthAlgo::Sticky; match &kind { LayerKind::Confined { cpus_range, util_range, nodes, llcs, - growth_algo, .. } => { - layer_growth_algo = growth_algo.clone(); let cpus_range = cpus_range.unwrap_or((0, std::usize::MAX)); if cpus_range.0 > cpus_range.1 || cpus_range.1 == 0 { bail!("invalid cpus_range {:?}", cpus_range); @@ -1475,7 +1473,6 @@ impl Layer { llcs, .. } => { - layer_growth_algo = growth_algo.clone(); if nodes.len() == 0 && llcs.len() == 0 { allowed_cpus.fill(true); } else { @@ -1964,13 +1961,7 @@ impl<'a, 'b> Scheduler<'a, 'b> { let mut layers = vec![]; for (idx, spec) in layer_specs.iter().enumerate() { - layers.push(Layer::new( - idx, - &cpu_pool, - &spec.name, - spec.kind.clone(), - &topo, - )?); + layers.push(Layer::new(&spec, idx, &cpu_pool, &spec.name, &topo)?); } // Other stuff.