The detailed comments present in (just before) the core kernel scheduling function kernel/sched/core.c:__schedule() are well worth reading through; they specify all the possible entry points to the kernel CPU scheduler. We have simply reproduced them here directly from the 5.4 kernel code base, so do take a look. Keep in mind: the following code is being run in process context by the process (thread, really) that's going to kick itself off the CPU by ultimately context-switching to some other thread! And this thread is who? Why, it's current, of course!
The __schedule() function has (among others) two local variables, pointer to struct task_struct named prev and next. The pointer named prev is set to rq->curr, which is nothing but current! The pointer named next will be set to the task that's going to be context-switched to, that's going to run next! So, you see: current runs the scheduler code, performing the...