mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 19:36:47 +00:00
设置idle进程的时间片为0,降低调度延迟 (#469)
This commit is contained in:
parent
666cffedab
commit
111c5407cc
@ -137,9 +137,14 @@ impl SchedulerCFS {
|
|||||||
fn update_cpu_exec_proc_jiffies(
|
fn update_cpu_exec_proc_jiffies(
|
||||||
_priority: SchedPriority,
|
_priority: SchedPriority,
|
||||||
cfs_queue: &mut CFSQueue,
|
cfs_queue: &mut CFSQueue,
|
||||||
|
is_idle: bool,
|
||||||
) -> &mut CFSQueue {
|
) -> &mut CFSQueue {
|
||||||
// todo: 引入调度周期以及所有进程的优先权进行计算,然后设置分配给进程的可执行时间
|
// todo: 引入调度周期以及所有进程的优先权进行计算,然后设置分配给进程的可执行时间
|
||||||
|
if !is_idle {
|
||||||
cfs_queue.cpu_exec_proc_jiffies = 10;
|
cfs_queue.cpu_exec_proc_jiffies = 10;
|
||||||
|
} else {
|
||||||
|
cfs_queue.cpu_exec_proc_jiffies = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return cfs_queue;
|
return cfs_queue;
|
||||||
}
|
}
|
||||||
@ -236,6 +241,7 @@ impl Scheduler for SchedulerCFS {
|
|||||||
SchedulerCFS::update_cpu_exec_proc_jiffies(
|
SchedulerCFS::update_cpu_exec_proc_jiffies(
|
||||||
proc.sched_info().priority(),
|
proc.sched_info().priority(),
|
||||||
current_cpu_queue,
|
current_cpu_queue,
|
||||||
|
Arc::ptr_eq(&proc, ¤t_cpu_queue.idle_pcb),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,6 +257,7 @@ impl Scheduler for SchedulerCFS {
|
|||||||
SchedulerCFS::update_cpu_exec_proc_jiffies(
|
SchedulerCFS::update_cpu_exec_proc_jiffies(
|
||||||
ProcessManager::current_pcb().sched_info().priority(),
|
ProcessManager::current_pcb().sched_info().priority(),
|
||||||
current_cpu_queue,
|
current_cpu_queue,
|
||||||
|
Arc::ptr_eq(&proc, ¤t_cpu_queue.idle_pcb),
|
||||||
);
|
);
|
||||||
// kdebug!("cpu:{:?}",current_cpu_id);
|
// kdebug!("cpu:{:?}",current_cpu_id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user