diff --git a/.github/actions/install-deps-action/action.yml b/.github/actions/install-deps-action/action.yml index 057685602..3083acd16 100644 --- a/.github/actions/install-deps-action/action.yml +++ b/.github/actions/install-deps-action/action.yml @@ -23,7 +23,12 @@ runs: linux-headers-generic linux-tools-common linux-tools-generic make \ ninja-build pahole pkg-config python3-dev python3-pip python3-requests \ qemu-kvm rsync stress-ng udev zstd libseccomp-dev libcap-ng-dev \ - llvm clang python3-full curl meson bpftrace cargo rustc dwarves + llvm clang python3-full curl meson bpftrace dwarves rustup + shell: bash + + # ensure some toolchain is installed + - run: | + rustup default nightly shell: bash # virtme-ng diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a70be64fc..fa04a7dc9 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,2 @@ [toolchain] -channel = "nightly-2024-09-10" -components = [ "rustfmt", "rustc-dev" ] -profile = "minimal" +channel = "nightly-2024-11-26" diff --git a/rust/scx_loader/src/config.rs b/rust/scx_loader/src/config.rs index 4dfb4f8f9..6edf52fd4 100644 --- a/rust/scx_loader/src/config.rs +++ b/rust/scx_loader/src/config.rs @@ -12,9 +12,9 @@ use std::path::Path; use anyhow::Result; use serde::Deserialize; -use crate::get_name_from_scx; use crate::SchedMode; use crate::SupportedSched; +use crate::get_name_from_scx; #[derive(Debug, PartialEq, Default, Deserialize)] #[serde(default)] diff --git a/rust/scx_loader/src/main.rs b/rust/scx_loader/src/main.rs index c04ad3927..5a4afbeb4 100644 --- a/rust/scx_loader/src/main.rs +++ b/rust/scx_loader/src/main.rs @@ -9,9 +9,9 @@ mod config; mod logger; use std::process::Stdio; +use std::sync::Arc; use std::sync::atomic::AtomicU32; use std::sync::atomic::Ordering; -use std::sync::Arc; use anyhow::Context; use anyhow::Result; @@ -25,8 +25,8 @@ use tokio::sync::mpsc::UnboundedReceiver; use tokio::sync::mpsc::UnboundedSender; use tokio::time::Duration; use tokio::time::Instant; -use zbus::interface; use zbus::Connection; +use zbus::interface; use zvariant::Type; use zvariant::Value; @@ -319,14 +319,11 @@ async fn main() -> Result<()> { let connection = Connection::system().await?; connection .object_server() - .at( - "/org/scx/Loader", - ScxLoader { - current_scx: None, - current_mode: SchedMode::Auto, - channel: channel.clone(), - }, - ) + .at("/org/scx/Loader", ScxLoader { + current_scx: None, + current_mode: SchedMode::Auto, + channel: channel.clone(), + }) .await?; connection.request_name("org.scx.Loader").await?; diff --git a/scheds/rust/scx_bpfland/src/main.rs b/scheds/rust/scx_bpfland/src/main.rs index b0ae10797..956ab20c7 100644 --- a/scheds/rust/scx_bpfland/src/main.rs +++ b/scheds/rust/scx_bpfland/src/main.rs @@ -16,24 +16,29 @@ use std::ffi::c_int; use std::fs::File; use std::io::Read; use std::mem::MaybeUninit; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::time::Duration; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::bail; use clap::Parser; use crossbeam::channel::RecvTimeoutError; +use libbpf_rs::OpenObject; +use libbpf_rs::ProgramInput; use libbpf_rs::skel::OpenSkel; use libbpf_rs::skel::Skel; use libbpf_rs::skel::SkelBuilder; -use libbpf_rs::OpenObject; -use libbpf_rs::ProgramInput; use log::info; use log::warn; use scx_stats::prelude::*; +use scx_utils::CoreType; +use scx_utils::Cpumask; +use scx_utils::NR_CPU_IDS; +use scx_utils::Topology; +use scx_utils::UserExitInfo; use scx_utils::build_id; use scx_utils::import_enums; use scx_utils::scx_enums; @@ -43,11 +48,6 @@ use scx_utils::scx_ops_open; use scx_utils::set_rlimit_infinity; use scx_utils::uei_exited; use scx_utils::uei_report; -use scx_utils::CoreType; -use scx_utils::Cpumask; -use scx_utils::Topology; -use scx_utils::UserExitInfo; -use scx_utils::NR_CPU_IDS; use stats::Metrics; const SCHEDULER_NAME: &'static str = "scx_bpfland"; @@ -406,15 +406,12 @@ impl<'a> Scheduler<'a> { "powersave" => 0, _ => -1, }; - info!( - "cpufreq performance level: {}", - match perf_lvl { - 1024 => "max".into(), - 0 => "min".into(), - n if n < 0 => "auto".into(), - _ => perf_lvl.to_string(), - } - ); + info!("cpufreq performance level: {}", match perf_lvl { + 1024 => "max".into(), + 0 => "min".into(), + n if n < 0 => "auto".into(), + _ => perf_lvl.to_string(), + }); skel.maps.bss_data.cpufreq_perf_lvl = perf_lvl; Ok(()) diff --git a/scheds/rust/scx_bpfland/src/stats.rs b/scheds/rust/scx_bpfland/src/stats.rs index 23869eb11..54bff1c61 100644 --- a/scheds/rust/scx_bpfland/src/stats.rs +++ b/scheds/rust/scx_bpfland/src/stats.rs @@ -1,13 +1,13 @@ use std::io::Write; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::time::Duration; use anyhow::Result; use scx_stats::prelude::*; -use scx_stats_derive::stat_doc; use scx_stats_derive::Stats; +use scx_stats_derive::stat_doc; use serde::Deserialize; use serde::Serialize; diff --git a/scheds/rust/scx_flash/src/main.rs b/scheds/rust/scx_flash/src/main.rs index f47c13b36..b752c1020 100644 --- a/scheds/rust/scx_flash/src/main.rs +++ b/scheds/rust/scx_flash/src/main.rs @@ -16,24 +16,26 @@ use std::ffi::c_int; use std::fs::File; use std::io::Read; use std::mem::MaybeUninit; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::time::Duration; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::bail; use clap::Parser; use crossbeam::channel::RecvTimeoutError; +use libbpf_rs::OpenObject; +use libbpf_rs::ProgramInput; use libbpf_rs::skel::OpenSkel; use libbpf_rs::skel::Skel; use libbpf_rs::skel::SkelBuilder; -use libbpf_rs::OpenObject; -use libbpf_rs::ProgramInput; use log::info; use log::warn; use scx_stats::prelude::*; +use scx_utils::Topology; +use scx_utils::UserExitInfo; use scx_utils::build_id; use scx_utils::import_enums; use scx_utils::scx_enums; @@ -43,8 +45,6 @@ use scx_utils::scx_ops_open; use scx_utils::set_rlimit_infinity; use scx_utils::uei_exited; use scx_utils::uei_report; -use scx_utils::Topology; -use scx_utils::UserExitInfo; use stats::Metrics; const SCHEDULER_NAME: &'static str = "scx_flash"; diff --git a/scheds/rust/scx_flash/src/stats.rs b/scheds/rust/scx_flash/src/stats.rs index 462a51c77..89e13eebe 100644 --- a/scheds/rust/scx_flash/src/stats.rs +++ b/scheds/rust/scx_flash/src/stats.rs @@ -6,9 +6,9 @@ // GNU General Public License version 2. use std::io::Write; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::time::Duration; use anyhow::Result; diff --git a/scheds/rust/scx_lavd/src/main.rs b/scheds/rust/scx_lavd/src/main.rs index a02a131cc..8432fa178 100644 --- a/scheds/rust/scx_lavd/src/main.rs +++ b/scheds/rust/scx_lavd/src/main.rs @@ -15,17 +15,17 @@ mod stats; use std::cell::Cell; use std::cell::RefCell; use std::collections::BTreeMap; -use std::ffi::c_int; use std::ffi::CStr; +use std::ffi::c_int; use std::fmt; use std::fs::File; use std::io::Read; use std::mem; use std::mem::MaybeUninit; use std::str; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::thread::ThreadId; use std::time::Duration; @@ -38,17 +38,20 @@ use crossbeam::channel::RecvTimeoutError; use crossbeam::channel::Sender; use crossbeam::channel::TrySendError; use itertools::iproduct; +use libbpf_rs::OpenObject; +use libbpf_rs::ProgramInput; use libbpf_rs::skel::OpenSkel; use libbpf_rs::skel::Skel; use libbpf_rs::skel::SkelBuilder; -use libbpf_rs::OpenObject; -use libbpf_rs::ProgramInput; use libc::c_char; use log::debug; use log::info; use log::warn; use plain::Plain; use scx_stats::prelude::*; +use scx_utils::NR_CPU_IDS; +use scx_utils::Topology; +use scx_utils::UserExitInfo; use scx_utils::build_id; use scx_utils::import_enums; use scx_utils::scx_enums; @@ -58,9 +61,6 @@ use scx_utils::scx_ops_open; use scx_utils::set_rlimit_infinity; use scx_utils::uei_exited; use scx_utils::uei_report; -use scx_utils::Topology; -use scx_utils::UserExitInfo; -use scx_utils::NR_CPU_IDS; use stats::SchedSample; use stats::SchedSamples; use stats::StatsReq; diff --git a/scheds/rust/scx_lavd/src/stats.rs b/scheds/rust/scx_lavd/src/stats.rs index dd7cc72e8..e3c8f0c43 100644 --- a/scheds/rust/scx_lavd/src/stats.rs +++ b/scheds/rust/scx_lavd/src/stats.rs @@ -1,17 +1,17 @@ use std::collections::BTreeMap; use std::io::Write; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::thread::ThreadId; use std::time::Duration; -use anyhow::bail; use anyhow::Result; +use anyhow::bail; use gpoint::GPoint; use scx_stats::prelude::*; -use scx_stats_derive::stat_doc; use scx_stats_derive::Stats; +use scx_stats_derive::stat_doc; use serde::Deserialize; use serde::Serialize; @@ -333,13 +333,10 @@ pub fn server_data(nr_cpus_onln: u64) -> StatsServerData { .add_meta(SysStats::meta()) .add_ops("top", StatsOps { open, close: None }) .add_meta(SchedSample::meta()) - .add_ops( - "sched_samples", - StatsOps { - open: samples_open, - close: None, - }, - ) + .add_ops("sched_samples", StatsOps { + open: samples_open, + close: None, + }) } pub fn monitor_sched_samples(nr_samples: u64, shutdown: Arc) -> Result<()> { diff --git a/scheds/rust/scx_layered/src/config.rs b/scheds/rust/scx_layered/src/config.rs index 5a3b4b07e..be9fd5386 100644 --- a/scheds/rust/scx_layered/src/config.rs +++ b/scheds/rust/scx_layered/src/config.rs @@ -9,8 +9,8 @@ use anyhow::Result; use serde::Deserialize; use serde::Serialize; -use crate::bpf_intf; use crate::LayerGrowthAlgo; +use crate::bpf_intf; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(transparent)] diff --git a/scheds/rust/scx_layered/src/layer_core_growth.rs b/scheds/rust/scx_layered/src/layer_core_growth.rs index ce573b4f1..e2e2f5286 100644 --- a/scheds/rust/scx_layered/src/layer_core_growth.rs +++ b/scheds/rust/scx_layered/src/layer_core_growth.rs @@ -7,9 +7,9 @@ use scx_utils::Topology; use serde::Deserialize; use serde::Serialize; -use crate::bpf_intf; use crate::CpuPool; use crate::LayerSpec; +use crate::bpf_intf; #[derive(Clone, Debug, Parser, Serialize, Deserialize)] #[clap(rename_all = "snake_case")] diff --git a/scheds/rust/scx_layered/src/lib.rs b/scheds/rust/scx_layered/src/lib.rs index d8a6d5a63..f33bcca61 100644 --- a/scheds/rust/scx_layered/src/lib.rs +++ b/scheds/rust/scx_layered/src/lib.rs @@ -9,8 +9,8 @@ pub mod bpf_intf; use std::collections::BTreeMap; -use anyhow::bail; use anyhow::Result; +use anyhow::bail; use bitvec::prelude::*; pub use config::LayerCommon; pub use config::LayerConfig; diff --git a/scheds/rust/scx_layered/src/main.rs b/scheds/rust/scx_layered/src/main.rs index dcb6a236f..f082a4fff 100644 --- a/scheds/rust/scx_layered/src/main.rs +++ b/scheds/rust/scx_layered/src/main.rs @@ -12,35 +12,41 @@ use std::fs; use std::io::Write; use std::mem::MaybeUninit; use std::ops::Sub; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::thread::ThreadId; use std::time::Duration; use std::time::Instant; use ::fb_procfs as procfs; -use anyhow::anyhow; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::anyhow; +use anyhow::bail; use bitvec::prelude::*; pub use bpf_skel::*; use clap::Parser; use crossbeam::channel::RecvTimeoutError; use lazy_static::lazy_static; -use libbpf_rs::skel::OpenSkel; -use libbpf_rs::skel::Skel; -use libbpf_rs::skel::SkelBuilder; use libbpf_rs::MapCore as _; use libbpf_rs::OpenObject; use libbpf_rs::ProgramInput; +use libbpf_rs::skel::OpenSkel; +use libbpf_rs::skel::Skel; +use libbpf_rs::skel::SkelBuilder; use log::debug; use log::info; use log::trace; use log::warn; use scx_layered::*; use scx_stats::prelude::*; +use scx_utils::CoreType; +use scx_utils::Llc; +use scx_utils::NR_CPUS_POSSIBLE; +use scx_utils::NetDev; +use scx_utils::Topology; +use scx_utils::UserExitInfo; use scx_utils::compat; use scx_utils::import_enums; use scx_utils::init_libbpf_logging; @@ -51,12 +57,6 @@ use scx_utils::scx_ops_load; use scx_utils::scx_ops_open; use scx_utils::uei_exited; use scx_utils::uei_report; -use scx_utils::CoreType; -use scx_utils::Llc; -use scx_utils::NetDev; -use scx_utils::Topology; -use scx_utils::UserExitInfo; -use scx_utils::NR_CPUS_POSSIBLE; use stats::LayerStats; use stats::StatsReq; use stats::StatsRes; @@ -142,10 +142,9 @@ lazy_static! { LayerSpec { name: "stress-ng".into(), comment: Some("stress-ng test layer".into()), - matches: vec![ - vec![LayerMatch::CommPrefix("stress-ng".into()),], - vec![LayerMatch::PcommPrefix("stress-ng".into()),] - ], + matches: vec![vec![LayerMatch::CommPrefix("stress-ng".into()),], vec![ + LayerMatch::PcommPrefix("stress-ng".into()), + ]], kind: LayerKind::Confined { cpus_range: None, util_range: (0.2, 0.8), diff --git a/scheds/rust/scx_layered/src/stats.rs b/scheds/rust/scx_layered/src/stats.rs index af9ddadac..a6ebd311a 100644 --- a/scheds/rust/scx_layered/src/stats.rs +++ b/scheds/rust/scx_layered/src/stats.rs @@ -1,33 +1,33 @@ use std::collections::BTreeMap; use std::io::Write; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; -use std::thread::current; use std::thread::ThreadId; +use std::thread::current; use std::time::Duration; use std::time::SystemTime; use std::time::UNIX_EPOCH; -use anyhow::bail; use anyhow::Result; +use anyhow::bail; use bitvec::prelude::*; use chrono::DateTime; use chrono::Local; use log::warn; use scx_stats::prelude::*; -use scx_stats_derive::stat_doc; use scx_stats_derive::Stats; +use scx_stats_derive::stat_doc; use serde::Deserialize; use serde::Serialize; -use crate::bpf_intf; use crate::BpfStats; -use crate::Layer; -use crate::Stats; use crate::LAYER_USAGE_OPEN; use crate::LAYER_USAGE_PROTECTED; use crate::LAYER_USAGE_SUM_UPTO; +use crate::Layer; +use crate::Stats; +use crate::bpf_intf; fn fmt_pct(v: f64) -> String { if v >= 99.995 { @@ -567,13 +567,10 @@ pub fn server_data() -> StatsServerData { StatsServerData::new() .add_meta(LayerStats::meta()) .add_meta(SysStats::meta()) - .add_ops( - "top", - StatsOps { - open, - close: Some(close), - }, - ) + .add_ops("top", StatsOps { + open, + close: Some(close), + }) } pub fn monitor(intv: Duration, shutdown: Arc) -> Result<()> { diff --git a/scheds/rust/scx_mitosis/src/main.rs b/scheds/rust/scx_mitosis/src/main.rs index 762e788a6..e6541f7bd 100644 --- a/scheds/rust/scx_mitosis/src/main.rs +++ b/scheds/rust/scx_mitosis/src/main.rs @@ -13,28 +13,29 @@ use std::fs::File; use std::mem::MaybeUninit; use std::os::fd::AsRawFd; use std::path::PathBuf; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; -use anyhow::anyhow; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::anyhow; +use anyhow::bail; use bitvec::prelude::*; use cgroupfs::CgroupReader; use clap::Parser; use itertools::Itertools; +use libbpf_rs::MapCore as _; +use libbpf_rs::OpenObject; use libbpf_rs::skel::OpenSkel; use libbpf_rs::skel::Skel; use libbpf_rs::skel::SkelBuilder; -use libbpf_rs::MapCore as _; -use libbpf_rs::OpenObject; use log::debug; use log::info; use log::trace; use maplit::btreemap; use maplit::hashmap; +use scx_utils::UserExitInfo; use scx_utils::compat; use scx_utils::import_enums; use scx_utils::init_libbpf_logging; @@ -45,7 +46,6 @@ use scx_utils::scx_ops_load; use scx_utils::scx_ops_open; use scx_utils::uei_exited; use scx_utils::uei_report; -use scx_utils::UserExitInfo; const RAVG_FRAC_BITS: u32 = bpf_intf::ravg_consts_RAVG_FRAC_BITS; const MAX_CPUS: usize = bpf_intf::consts_MAX_CPUS as usize; @@ -506,14 +506,11 @@ impl<'a> Scheduler<'a> { cell_idx ) })?; - cell.cgroups.insert( - name.clone(), - Cgroup { - name, - load, - pinned_load, - }, - ); + cell.cgroups.insert(name.clone(), Cgroup { + name, + load, + pinned_load, + }); cell.load += load; cell.pinned_load += pinned_load; } @@ -686,19 +683,16 @@ impl<'a> Scheduler<'a> { .ok_or(anyhow!("Could not change cell of cgroup to be split"))?; *cg_cell = new_cell_idx; } - self.cells.insert( - new_cell_idx, - Cell { - cgroups: split - .g2 - .into_iter() - .map(|cg| (cg.name.clone(), cg)) - .collect(), - cpu_assignment: bitvec!(0; *NR_POSSIBLE_CPUS), - load: new_cell_load, - pinned_load: new_cell_pinned_load, - }, - ); + self.cells.insert(new_cell_idx, Cell { + cgroups: split + .g2 + .into_iter() + .map(|cg| (cg.name.clone(), cg)) + .collect(), + cpu_assignment: bitvec!(0; *NR_POSSIBLE_CPUS), + load: new_cell_load, + pinned_load: new_cell_pinned_load, + }); let old_cell = self .cells .get_mut(&split.cell) diff --git a/scheds/rust/scx_rustland/src/stats.rs b/scheds/rust/scx_rustland/src/stats.rs index e88ff26ac..40a0a17fa 100644 --- a/scheds/rust/scx_rustland/src/stats.rs +++ b/scheds/rust/scx_rustland/src/stats.rs @@ -3,8 +3,8 @@ use std::time::Duration; use anyhow::Result; use scx_stats::prelude::*; -use scx_stats_derive::stat_doc; use scx_stats_derive::Stats; +use scx_stats_derive::stat_doc; use serde::Deserialize; use serde::Serialize; diff --git a/scheds/rust/scx_rusty/src/load_balance.rs b/scheds/rust/scx_rusty/src/load_balance.rs index c8d5b2676..1670c79b2 100644 --- a/scheds/rust/scx_rusty/src/load_balance.rs +++ b/scheds/rust/scx_rusty/src/load_balance.rs @@ -137,23 +137,23 @@ use std::collections::VecDeque; use std::fmt; use std::sync::Arc; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::bail; use libbpf_rs::MapCore as _; use log::debug; use log::warn; use ordered_float::OrderedFloat; -use scx_utils::ravg::ravg_read; use scx_utils::LoadAggregator; use scx_utils::LoadLedger; +use scx_utils::ravg::ravg_read; use sorted_vec::SortedVec; +use crate::DomainGroup; use crate::bpf_intf; use crate::bpf_skel::*; use crate::stats::DomainStats; use crate::stats::NodeStats; -use crate::DomainGroup; const DEFAULT_WEIGHT: f64 = bpf_intf::consts_LB_DEFAULT_WEIGHT as f64; const RAVG_FRAC_BITS: u32 = bpf_intf::ravg_consts_RAVG_FRAC_BITS; diff --git a/scheds/rust/scx_rusty/src/main.rs b/scheds/rust/scx_rusty/src/main.rs index 9fbd5f1cf..9542b830e 100644 --- a/scheds/rust/scx_rusty/src/main.rs +++ b/scheds/rust/scx_rusty/src/main.rs @@ -18,9 +18,9 @@ use load_balance::LoadBalancer; mod stats; use std::collections::BTreeMap; use std::mem::MaybeUninit; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::time::Duration; use std::time::Instant; use std::time::SystemTime; @@ -33,19 +33,23 @@ use stats::NodeStats; extern crate static_assertions; use ::fb_procfs as procfs; -use anyhow::anyhow; -use anyhow::bail; use anyhow::Context; use anyhow::Result; +use anyhow::anyhow; +use anyhow::bail; use clap::Parser; use crossbeam::channel::RecvTimeoutError; +use libbpf_rs::MapCore as _; +use libbpf_rs::OpenObject; use libbpf_rs::skel::OpenSkel; use libbpf_rs::skel::Skel; use libbpf_rs::skel::SkelBuilder; -use libbpf_rs::MapCore as _; -use libbpf_rs::OpenObject; use log::info; use scx_stats::prelude::*; +use scx_utils::Cpumask; +use scx_utils::NR_CPU_IDS; +use scx_utils::Topology; +use scx_utils::UserExitInfo; use scx_utils::build_id; use scx_utils::compat; use scx_utils::import_enums; @@ -56,10 +60,6 @@ use scx_utils::scx_ops_load; use scx_utils::scx_ops_open; use scx_utils::uei_exited; use scx_utils::uei_report; -use scx_utils::Cpumask; -use scx_utils::Topology; -use scx_utils::UserExitInfo; -use scx_utils::NR_CPU_IDS; const MAX_DOMS: usize = bpf_intf::consts_MAX_DOMS as usize; const MAX_CPUS: usize = bpf_intf::consts_MAX_CPUS as usize; diff --git a/scheds/rust/scx_rusty/src/stats.rs b/scheds/rust/scx_rusty/src/stats.rs index 021b3510c..a7a7eaae0 100644 --- a/scheds/rust/scx_rusty/src/stats.rs +++ b/scheds/rust/scx_rusty/src/stats.rs @@ -1,8 +1,8 @@ use std::collections::BTreeMap; use std::io::Write; +use std::sync::Arc; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::time::Duration; use std::time::UNIX_EPOCH; @@ -10,10 +10,10 @@ use anyhow::Result; use chrono::DateTime; use chrono::Local; use scx_stats::prelude::*; -use scx_stats_derive::stat_doc; use scx_stats_derive::Stats; -use scx_utils::normalize_load_metric; +use scx_stats_derive::stat_doc; use scx_utils::Cpumask; +use scx_utils::normalize_load_metric; use serde::Deserialize; use serde::Serialize; diff --git a/scheds/rust/scx_rusty/src/tuner.rs b/scheds/rust/scx_rusty/src/tuner.rs index eb8efad6f..9071e0a2b 100644 --- a/scheds/rust/scx_rusty/src/tuner.rs +++ b/scheds/rust/scx_rusty/src/tuner.rs @@ -6,14 +6,14 @@ use std::collections::BTreeMap; use std::sync::Arc; use ::fb_procfs as procfs; +use anyhow::Result; use anyhow::anyhow; use anyhow::bail; -use anyhow::Result; use scx_utils::Cpumask; -use crate::sub_or_zero; use crate::BpfSkel; use crate::DomainGroup; +use crate::sub_or_zero; fn calc_util(curr: &procfs::CpuStat, prev: &procfs::CpuStat) -> Result { match (curr, prev) {