Reduce schreduler time slices to reduce latency

This commit is contained in:
Jeremy Soller
2022-09-07 18:21:30 -06:00
parent 07ed93225e
commit f5bdae2d0c
5 changed files with 10 additions and 5 deletions

View File

@@ -59,7 +59,8 @@ pub unsafe fn irq_handler_gentimer(irq: u32) {
timeout::trigger();
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 10 {
// Switch after 3 ticks (about 6.75 ms)
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 2 {
let _ = context::switch();
}
trigger(irq);

View File

@@ -24,7 +24,8 @@ interrupt!(switch, || {
interrupt!(pit, || {
LOCAL_APIC.eoi();
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 10 {
// Switch after 3 ticks (about 6.75 ms)
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 2 {
let _ = context::switch();
}
});

View File

@@ -189,7 +189,8 @@ interrupt_stack!(pit_stack, |_stack| {
// Any better way of doing this?
timeout::trigger();
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 10 {
// Switch after 3 ticks (about 6.75 ms)
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 2 {
let _ = context::switch();
}
});

View File

@@ -24,7 +24,8 @@ interrupt!(switch, || {
interrupt!(pit, || {
LOCAL_APIC.eoi();
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 10 {
// Switch after 3 ticks (about 6.75 ms)
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 2 {
let _ = context::switch();
}
});

View File

@@ -189,7 +189,8 @@ interrupt_stack!(pit_stack, |_stack| {
// Any better way of doing this?
timeout::trigger();
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 10 {
// Switch after 3 ticks (about 6.75 ms)
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 2 {
let _ = context::switch();
}
});