mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 01:43:22 +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::{
|
||||
arch::qemu::{exit_qemu, QemuExitCode},
|
||||
boot,
|
||||
cpu::PinCurrentCpu,
|
||||
cpu::{CpuId, CpuSet, PinCurrentCpu},
|
||||
};
|
||||
use process::Process;
|
||||
|
||||
@ -81,8 +81,11 @@ pub fn main() {
|
||||
ostd::boot::smp::register_ap_entry(ap_init);
|
||||
|
||||
// Spawn the first kernel thread on BSP.
|
||||
let mut affinity = CpuSet::new_empty();
|
||||
affinity.add(CpuId::bsp());
|
||||
ThreadOptions::new(init_thread)
|
||||
.priority(Priority::idle())
|
||||
.cpu_affinity(affinity)
|
||||
.spawn();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user