Entry and exit of kernel schedule() function -
i know kernel scheduler run periodically. period determined timer. however, have been unable find irq timer interrupt , entire flow beginning end of scheduler code.
i understand schedule() function may potentially have several entry , exit points.. point me towards these?
from kernel source, i've gathered __schedule() main schedule function seems called schedule().. calls schedule()..and calls function calls schedule.. ..
there 2 schedulers, or rather 2 scheduling codes in linux kernel. there core scheduler, mentioned called schedule() calls __schedule(). schedule() called many points in kernel:
- explicit blocking, in case of semaphores, mutexes etc.
- a flag tif_need_resched checked on interrupts , on return userspace, if set schedule called.
- a process wakes up.
there scheduler code name scheduler_tick()[this resides in core.c], periodic scheduler , called timer code(timer.c) via interrupt frequency of hz, i.e. scheduler_tick() called hz times in 1 second. hz hardware dependent , value varies between 100-1024. scheduler_tick() calls task_tick() of scheduling class current task on processor belongs.
Comments
Post a Comment