mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-28 04:43:23 +00:00
Block IO Scheduler (#158)
* Block io调度器 * process_wakeup时,对cfs的进程,重设虚拟运行时间。解决由于休眠的进程,其虚拟运行时间过小,导致其他进程饥饿的问题 * 1、为AP核启动apic_timer,使其能够运行调度 2、增加kick_cpu功能,支持让某个特定核心立即运行调度器 3、wait_queue的唤醒,改为立即唤醒。 4、增加进程在核心间迁移的功能 5、CFS调度器为每个核心设置单独的IDLE进程pcb(pid均为0) 6、pcb中增加migrate_to字段 7、当具有多核时,io调度器在核心1上运行。 * io调度器文件位置修改 * 修改io的makefile * 更新makefile中的变量名 * 修改io调度器函数名 --------- Co-authored-by: login <longjin@ringotek.cn>
This commit is contained in:
@ -2,17 +2,17 @@ use core::arch::asm;
|
||||
|
||||
/// @brief 获取当前cpu的apic id
|
||||
#[inline]
|
||||
pub fn arch_current_apic_id() -> u8 {
|
||||
pub fn current_cpu_id() -> u8 {
|
||||
let cpuid_res: u32;
|
||||
unsafe {
|
||||
asm!(
|
||||
"mov eax, 1",
|
||||
"cpuid",
|
||||
"mov r15, ebx",
|
||||
"mov r15, rbx",
|
||||
lateout("r15") cpuid_res
|
||||
);
|
||||
}
|
||||
return (cpuid_res >> 24) as u8;
|
||||
return ((cpuid_res >> 24) & 0xff) as u8;
|
||||
}
|
||||
|
||||
/// @brief 通过pause指令,让cpu休息一会儿。降低空转功耗
|
||||
|
Reference in New Issue
Block a user