mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 09:53:24 +00:00
Set affinity for BSP idle thread
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d14d4b9312
commit
285dde5546
@ -33,7 +33,7 @@
|
|||||||
use ostd::{
|
use ostd::{
|
||||||
arch::qemu::{exit_qemu, QemuExitCode},
|
arch::qemu::{exit_qemu, QemuExitCode},
|
||||||
boot,
|
boot,
|
||||||
cpu::PinCurrentCpu,
|
cpu::{CpuId, CpuSet, PinCurrentCpu},
|
||||||
};
|
};
|
||||||
use process::Process;
|
use process::Process;
|
||||||
|
|
||||||
@ -81,8 +81,11 @@ pub fn main() {
|
|||||||
ostd::boot::smp::register_ap_entry(ap_init);
|
ostd::boot::smp::register_ap_entry(ap_init);
|
||||||
|
|
||||||
// Spawn the first kernel thread on BSP.
|
// Spawn the first kernel thread on BSP.
|
||||||
|
let mut affinity = CpuSet::new_empty();
|
||||||
|
affinity.add(CpuId::bsp());
|
||||||
ThreadOptions::new(init_thread)
|
ThreadOptions::new(init_thread)
|
||||||
.priority(Priority::idle())
|
.priority(Priority::idle())
|
||||||
|
.cpu_affinity(affinity)
|
||||||
.spawn();
|
.spawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user