when/how is the schedule() function actually called?
Dawei Li <[email protected]> Thu, 7 Dec 2023 13:59:55 +0800
| Newsgroups | org.kernel.vger.linux-smp,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-newbie |
|---|---|
| Message-ID | <CAG5MgCpdTt5ZpSVg==YN92zr+0_ug+3sUOAwdjXJEu0a1BkWFg@mail.gmail.com> |
Greetings! I am reading several resources regarding the linux kernel scheduling in kernel 2.6.34. There seems to be the periodic scheduler (tick_periodic()), which invokes the scheduler_tick() function, then the entity_tick() function, and then the resched_task() function. However, eventually, the resched_task() function doesn't invoke the schedule() function; it only invokes the set_tsk_need_resched() function. So, it is only setting the need_resched flag. My question is, when/how is the schedule() function actually called? Also, I notice that at many locations in the code, when there is the need to do a scheduling, the code is just setting the need_resched flag. Same question: when/how is the schedule() function actually called? Not sure if this list is still active. Appreciate any response. Thanks!