I am trying to learn some more about the scheduling architecture in Linux. At a very high level I understand that many events can trigger the invocation of the scheduler in Linux, e.g. I/O events such as blocking on I/O or the receipt of some network data etc can all lead to the invocation of the scheduler.
As I understand it, the scheduler is also invoked to preempt processes that may have utilized their running time slice. I presume that this trigger is derived from the system clock ? And if so, where exactly is the scheduler invoked ? I searched in the code base and I noticed that scheduler function kernel/sched.c:schedule() being invoked in multiple lines of the source code; however I was unable to locate where it is invoked by the system clock or whatever clock triggers the scheduler.
Any and all help would be much appreciated.
Thanks very much in advance!