Im reading the ostep and i just finished the intro to MLFQ.
Let’s consider the top queue (highest priority one) for my qn, so the tasks in it are scheduled in a RR way with a time slice of lets say 10ms(ive no idea what this value is on modern cpus but in the book from 2008 they say 10ms). I read in the previous chapters that the operating system regains control using timer interrupts every 1ms or so.
So this mean that when executing a high priority task for 10ms there are 10 interupts that happen (1 every 1ms) and that each time the scheduler says to keep running the same task? it sounds like some huge overhead that isnt needed.
I tried to think about explanations that would make sense, here are my thoughts:
The frequent interrupts are needed in case the os wants to run something on kernel side at any moment, it wouldnt be optimised to force the os to wait 10ms while perhaps it has some important things to execute as soon as possible (Ive no idea what kind of task it could be)
Also i read about the NO_HZ mode to disable scheduling clock interrupts so i wonder if the scheduling clock is the same clock as the one they mention in the book that produce “timer interrupts”, and if there are different type of clocks emitting different type of interrupts, which can be disabled etc.
Thanks for reading this, i hope some more experimented guys can make it more clear to me!
i havent tried anything, just trying to understand!
4cAsrSgN9r is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.