From 6416123cfb52703c609c16c9c31c7fa58cfe7a68 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 23 Mar 2019 22:22:01 +0100 Subject: [PATCH] Kernel: Set the colonel task to low priority. This gives it a smaller time slice, improving responsiveness. --- Kernel/Scheduler.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index 0bdcb544c2..ef5f4aede5 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -294,11 +294,6 @@ void Scheduler::switch_now() bool Scheduler::context_switch(Thread& thread) { thread.set_ticks_left(time_slice_for(thread.process().priority())); - - // FIXME(Thread): This is such a hack. - if (&thread == &s_colonel_process->main_thread()) - thread.set_ticks_left(1); - thread.did_schedule(); if (current == &thread) @@ -386,6 +381,8 @@ void Scheduler::initialize() s_redirection.selector = gdt_alloc_entry(); initialize_redirection(); s_colonel_process = Process::create_kernel_process("colonel", nullptr); + // Make sure the colonel uses a smallish time slice. + s_colonel_process->set_priority(Process::LowPriority); load_task_register(s_redirection.selector); }