Kernel: Disable scheduler load balancing until I get it fixed

Scheduler keeps crashing all the time when running on multiple cores.
This patch disabled the load balancer, which seems to get rid of most
scheduler crashes.
This commit is contained in:
Bananymous 2024-08-25 15:29:05 +03:00
parent 991ae4383a
commit 72f8138ca1
1 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,7 @@
#define DEBUG_SCHEDULER 0
#define SCHEDULER_ASSERT 1
#define SCHEDULER_LOAD_BALANCE 0
#if SCHEDULER_ASSERT == 0
#undef ASSERT
@ -295,6 +296,7 @@ namespace Kernel
{
ASSERT(Processor::get_interrupt_state() == InterruptState::Disabled);
if constexpr(SCHEDULER_LOAD_BALANCE)
if (Processor::is_smp_enabled())
do_load_balancing();
@ -386,6 +388,7 @@ namespace Kernel
return least_loaded_id;
}
#if SCHEDULER_LOAD_BALANCE
void Scheduler::do_load_balancing()
{
ASSERT(Processor::get_interrupt_state() == InterruptState::Disabled);
@ -563,6 +566,7 @@ namespace Kernel
m_last_load_balance_ns += s_load_balance_interval_ns;
}
#endif
BAN::ErrorOr<void> Scheduler::add_thread(Thread* thread)
{