调度event
微信运行在cpu
ActivityPause 调用完再唤醒微信,调度延迟
将trace 转换成文本内容后,从perfetto 显示的Start time 为该文本开始的偏移
唤醒微信:
选核cpu 6
sched_task_util: pid=5772 comm=com.tencent.mm util=90 prev_cpu=3 candidates=0x40 best_energy_cpu=6 sync=1 need_idle=0 fastpath=4 placement_boost=1 latency=3854 stune_boosted=0 is_rtg=1 rtg_skip_min=0 start_cpu=4 unfilter=0 affinity=ff task_boost=0 low_latency=0 iowaited=0
sched_wakeup: comm=com.tencent.mm pid=5772 prio=110 target_cpu=006
调度延迟:
这个时候才轮到运行
1、微信ActivityResume 时,运行cpu6上,binder 调用到system_server 进入阻塞;待binder 返回,唤醒微信,之前在6核,现在选0核,是由于 fastpath=4 ;
DefaultDispatch 9255-9255 ( 8083) [000] d..2 180384.400135: sched_switch: prev_comm=DefaultDispatch prev_pid=9255 prev_prio=120 prev_state=R+ ==> next_comm=com.tencent.mm next_pid=5772 next_prio=110
walt_find_energy_efficient_cpu 选核,调用walt_find_best_target 调用自研sched ,候选cpu不为空,设置 fbt_env.fastpath == NR_WAKEUP_SELECT;根据 fbt_env.fastpath == NR_WAKEUP_SELECT 设置最好能效cpu为候选第一个cpu,而候选cpu 刚好是 cpu 0。