pub struct Cache {
pub level: u8,
pub kind: CacheKind,
pub size_bytes: Option<u64>,
pub line_size_bytes: Option<u32>,
pub ways_of_associativity: Option<u32>,
pub shared_cpus: Vec<LogicalId>,
}Expand description
One cache instance, plus the set of logical CPUs that share it.
Sharing is the load-bearing field. Two threads that share an L2 contend for it; two threads that want to share data are much cheaper to co-locate under one L3 than to spread across sockets.
Fields§
§level: u8§kind: CacheKind§size_bytes: Option<u64>Size in bytes. None when the kernel did not expose it.
line_size_bytes: Option<u32>§ways_of_associativity: Option<u32>Logical CPUs sharing this exact cache instance, ascending.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cache
impl<'de> Deserialize<'de> for Cache
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Cache
impl StructuralPartialEq for Cache
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnsafeUnpin for Cache
impl UnwindSafe for Cache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more