From 97fb0fa0c8a17f3f6a45e591c25069bbb3556e1e Mon Sep 17 00:00:00 2001 From: Daniel Hodges Date: Tue, 16 Jul 2024 07:42:03 -0700 Subject: [PATCH] scx_utils: Add LLC id to CPU Add the LLC id to the Cpu struct, which will make it easier for referencing the LLC when doing operations on a Cpu. Signed-off-by: Daniel Hodges --- rust/scx_utils/src/topology.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust/scx_utils/src/topology.rs b/rust/scx_utils/src/topology.rs index 087b7d2..7aa05da 100644 --- a/rust/scx_utils/src/topology.rs +++ b/rust/scx_utils/src/topology.rs @@ -83,6 +83,7 @@ pub struct Cpu { min_freq: usize, max_freq: usize, trans_lat_ns: usize, + llc_id: usize, } impl Cpu { @@ -105,6 +106,11 @@ impl Cpu { pub fn trans_lat_ns(&self) -> usize { self.trans_lat_ns } + + /// Get the LLC id of the this Cpu + pub fn llc_id(&self) -> usize { + self.llc_id + } } #[derive(Debug, Clone)] @@ -414,6 +420,7 @@ fn create_insert_cpu(cpu_id: usize, node: &mut Node, online_mask: &Cpumask) -> R min_freq: min_freq, max_freq: max_freq, trans_lat_ns: trans_lat_ns, + llc_id: llc_id, }, );