Analyzing the Android Scheduler - Is the process waking itself up?

I am currently using ftrace (via atrace on Android in particular) to help me figure out my scheduler thread wakeup thread. However, the line below is confusing me. This assumes that the current task (ls-4787) wakes up itself (comm = ls pid = 4787).

Why or how will this happen? I can't think of a situation where the currently running process (which is already in the execution queue!) To ... add itself to the queue. Am I reading this wrong? Thanks for any help you could offer!

 kworker/0:0-4692  ( 4692) [000] d..3 52894.176161: sched_switch: prev_comm=kworker/0:0 prev_pid=4692 prev_prio=120 prev_state=S ==> next_comm=ls next_pid=4787 next_prio=120
        adbd-209   (  209) [001] d..3 52894.176192: sched_switch: prev_comm=adbd prev_pid=209 prev_prio=120 prev_state=S ==> next_comm=adbd next_pid=230 next_prio=120
          ls-4787  ( 4787) [000] dN.4 52894.176204: sched_wakeup: comm=kworker/0:0 pid=4692 prio=120 success=1 target_cpu=000
          ls-4787  ( 4787) [000] dN.4 52894.176211: sched_wakeup: comm=ls pid=4787 prio=120 success=1 target_cpu=000
          ls-4787  ( 4787) [000] d..3 52894.176221: sched_switch: prev_comm=ls prev_pid=4787 prev_prio=120 prev_state=R+ ==> next_comm=kworker/0:0 next_pid=4692 next_prio=120

      

As a complement, these strange instances are always associated with the kworker event, but I'm not sure why this would affect the scheduler's perspective.

+3


source to share





All Articles