Within the timer interrupt (in the code of kernel/sched/core.c:scheduler_tick(), wherein interrupts are disabled), the kernel performs the meta work necessary to keep scheduling running smoothly; this involves the constant updating of the per CPU runqueues as appropriate, load balancing work, and so on. Please be aware that the actual schedule() function is never called here. At best, the scheduling class hook function (for the process context current that was interrupted), sched_class:task_tick(), if non-null, is invoked. For example, for any thread belonging to the fair (CFS) class, the update of the vruntime member (the virtual runtime, the (priority-biased) time spent on the processor by the task) is done here in task_tick_fair().
Now, a key point, it's the scheduling code that decides: do we need to...