Skip to content

Commit

Permalink
fix rebase, run fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
likewhatevs committed Oct 4, 2024
1 parent 8e12767 commit 8bf6966
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions scheds/rust/scx_layered/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1408,26 +1408,24 @@ struct Layer {

impl Layer {
fn new(
spec: &LayerSpec,
idx: usize,
cpu_pool: &CpuPool,
name: &str,
kind: LayerKind,
topo: &Topology,
) -> Result<Self> {
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);
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8bf6966

Please sign in to comment.