forked from Bananymous/banan-os
Kernel: Now all active processors are used in scheduling
When a timer reschedule happens, ipi is broadcasted too all processors for them to perform a reschedule!
This commit is contained in:
parent
89ca4c8a8b
commit
e65bc040af
|
@ -310,10 +310,12 @@ done:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InterruptController::get().eoi(irq);
|
InterruptController::get().eoi(irq);
|
||||||
if (s_interruptables[irq])
|
if (irq == IRQ_IPI)
|
||||||
s_interruptables[irq]->handle_irq();
|
Scheduler::get().reschedule();
|
||||||
|
else if (auto* handler = s_interruptables[irq])
|
||||||
|
handler->handle_irq();
|
||||||
else
|
else
|
||||||
dprintln("no handler for irq 0x{2H}\n", irq);
|
dprintln("no handler for irq 0x{2H}", irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
Scheduler::get().reschedule_if_idling();
|
Scheduler::get().reschedule_if_idling();
|
||||||
|
|
|
@ -67,6 +67,10 @@ namespace Kernel
|
||||||
|
|
||||||
void Scheduler::timer_reschedule()
|
void Scheduler::timer_reschedule()
|
||||||
{
|
{
|
||||||
|
// Broadcast IPI to all other processors for them
|
||||||
|
// to perform reschedule
|
||||||
|
InterruptController::get().broadcast_ipi();
|
||||||
|
|
||||||
auto state = m_lock.lock();
|
auto state = m_lock.lock();
|
||||||
m_blocking_threads.remove_with_wake_time(m_active_threads, SystemTimer::get().ms_since_boot());
|
m_blocking_threads.remove_with_wake_time(m_active_threads, SystemTimer::get().ms_since_boot());
|
||||||
if (save_current_thread())
|
if (save_current_thread())
|
||||||
|
|
Loading…
Reference in New Issue