[kernel] Give scheduler better history tracking

The scheduler again tracks remaining timeslice. Timeslices are bigger,
but once a process uses all of its timeslice, it's demoted and
replenished at the next priority. The scheduler also tracks the last
time a process ran, and promotes it if it's been starved for twice its
full timeslice.

TODO: replenish a small amount of timeslice each time a process is run,
so that more interactive processes keep their priorities.
This commit is contained in:
Justin C. Miller
2020-06-05 00:15:03 -07:00
parent a10aca573d
commit b4adc29d7f
5 changed files with 58 additions and 30 deletions

View File

@@ -83,7 +83,7 @@ process_sleep(uint64_t til)
{
auto &s = scheduler::get();
auto *p = s.current();
log::debug(logs::syscall, "Process %d sleeping until %d", p->pid, til);
log::debug(logs::syscall, "Process %d sleeping until %llu", p->pid, til);
p->wait_on_time(til);
s.schedule();