mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:07:34 +00:00
Kernel: Set the colonel task to low priority.
This gives it a smaller time slice, improving responsiveness.
This commit is contained in:
parent
8501fdc6f5
commit
6416123cfb
1 changed files with 2 additions and 5 deletions
|
@ -294,11 +294,6 @@ void Scheduler::switch_now()
|
||||||
bool Scheduler::context_switch(Thread& thread)
|
bool Scheduler::context_switch(Thread& thread)
|
||||||
{
|
{
|
||||||
thread.set_ticks_left(time_slice_for(thread.process().priority()));
|
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();
|
thread.did_schedule();
|
||||||
|
|
||||||
if (current == &thread)
|
if (current == &thread)
|
||||||
|
@ -386,6 +381,8 @@ void Scheduler::initialize()
|
||||||
s_redirection.selector = gdt_alloc_entry();
|
s_redirection.selector = gdt_alloc_entry();
|
||||||
initialize_redirection();
|
initialize_redirection();
|
||||||
s_colonel_process = Process::create_kernel_process("colonel", nullptr);
|
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);
|
load_task_register(s_redirection.selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue