Reduce schreduler time slices to reduce latency
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user