mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-01-30 17:11:47 -05:00
Refactor vruntime to v_runtime
This commit is contained in:
@@ -142,7 +142,7 @@ pub async fn sys_clone(
|
||||
priority: current_task.priority,
|
||||
sig_mask: SpinLock::new(new_sigmask),
|
||||
pending_signals: SpinLock::new(SigSet::empty()),
|
||||
vruntime: SpinLock::new(0),
|
||||
v_runtime: SpinLock::new(0),
|
||||
v_eligible: SpinLock::new(0),
|
||||
v_deadline: SpinLock::new(0),
|
||||
exec_start: SpinLock::new(None),
|
||||
|
||||
@@ -182,7 +182,7 @@ pub struct Task {
|
||||
pub ctx: SpinLock<Context>,
|
||||
pub sig_mask: SpinLock<SigSet>,
|
||||
pub pending_signals: SpinLock<SigSet>,
|
||||
pub vruntime: SpinLock<u128>,
|
||||
pub v_runtime: SpinLock<u128>,
|
||||
/// Virtual time at which the task becomes eligible (v_ei).
|
||||
pub v_eligible: SpinLock<u128>,
|
||||
/// Virtual deadline (v_di) used by the EEVDF scheduler.
|
||||
@@ -222,7 +222,7 @@ impl Task {
|
||||
vm: Arc::new(SpinLock::new(vm)),
|
||||
sig_mask: SpinLock::new(SigSet::empty()),
|
||||
pending_signals: SpinLock::new(SigSet::empty()),
|
||||
vruntime: SpinLock::new(0),
|
||||
v_runtime: SpinLock::new(0),
|
||||
v_eligible: SpinLock::new(0),
|
||||
v_deadline: SpinLock::new(0),
|
||||
exec_start: SpinLock::new(None),
|
||||
@@ -249,7 +249,7 @@ impl Task {
|
||||
)),
|
||||
fd_table: Arc::new(SpinLock::new(FileDescriptorTable::new())),
|
||||
pending_signals: SpinLock::new(SigSet::empty()),
|
||||
vruntime: SpinLock::new(0),
|
||||
v_runtime: SpinLock::new(0),
|
||||
v_eligible: SpinLock::new(0),
|
||||
v_deadline: SpinLock::new(0),
|
||||
exec_start: SpinLock::new(None),
|
||||
|
||||
@@ -296,7 +296,7 @@ impl SchedState {
|
||||
let delta = now_inst - start;
|
||||
let w = prev_task.weight() as u128;
|
||||
let dv = ((delta.as_nanos() as u128) << VT_FIXED_SHIFT) / w;
|
||||
*prev_task.vruntime.lock_save_irq() += dv;
|
||||
*prev_task.v_runtime.lock_save_irq() += dv;
|
||||
dv
|
||||
} else {
|
||||
0
|
||||
@@ -376,8 +376,8 @@ impl SchedState {
|
||||
let vd2 = *proc2.v_deadline.lock_save_irq();
|
||||
|
||||
vd1.cmp(&vd2).then_with(|| {
|
||||
let vr1 = *proc1.vruntime.lock_save_irq();
|
||||
let vr2 = *proc2.vruntime.lock_save_irq();
|
||||
let vr1 = *proc1.v_runtime.lock_save_irq();
|
||||
let vr2 = *proc2.v_runtime.lock_save_irq();
|
||||
|
||||
vr1.cmp(&vr2).then_with(|| {
|
||||
let last_run1 = proc1.last_run.lock_save_irq();
|
||||
|
||||
Reference in New Issue
Block a user