mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 21:26:50 +00:00
Default affinity mask to cores available rather than nil.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
9346e69b87
commit
8a95390f1c
1 file changed
+9
-1
@@ -65,7 +65,15 @@ where
|
||||
}
|
||||
|
||||
/// Get the core affinity for this thread.
|
||||
pub fn get_affinity() -> impl Iterator<Item = Id> { from_mask(CORE_AFFINITY.get()) }
|
||||
pub fn get_affinity() -> impl Iterator<Item = Id> {
|
||||
CORE_AFFINITY
|
||||
.get()
|
||||
.ne(&0)
|
||||
.then_some(from_mask(CORE_AFFINITY.get()))
|
||||
.or_else(|| Some(from_mask(*CORES_AVAILABLE)))
|
||||
.into_iter()
|
||||
.flatten()
|
||||
}
|
||||
|
||||
/// List the cores sharing SMT-tier resources
|
||||
pub fn smt_siblings() -> impl Iterator<Item = Id> {
|
||||
|
||||
Reference in new issue
Block a user