Re: when/how is the schedule() function actually called?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> But I don't see any code that is calling the schedule or __schedule function.

I think with a little investigation, you will be able to figure it out.  For example, arch/x86/entry/common.c
in function do_syscall_64 calls syscall_entr_from_user_mode and syscall_exit_to_user_mode.   I could guess
we eventually reach exit_to_user_mode_loop, which will conditionally call schedule() which calls __schedule
(although I didn't investigate this chain, so am just guessing).

I'm a newbie to this stuff as well, but it is not too difficult to follow this.  I would guess there are
IDEs available that can help you with diagramming the flow if you don't want to manually find things
one layer at a time.  The Documentation folder also has a lot of good information.  For example,
Documentation/trace/histogram.rst shows some backtraces with __schedule, and you can see
examples of how it is called from do_syscall_64 and ret_from_fork.  Other traces are available in
Documentation/trace/ftrace.rst

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux