函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\fair.c Create Date:2022-07-27 10:38:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:更新当前进程运行时间,包括虚拟运行时间

函数原型:static void update_curr(struct cfs_rq *cfs_rq)

返回类型:void

参数:

类型参数名称
struct cfs_rq *cfs_rq
834  curr等于'curr' points to currently running entity on this cfs_rq.* It is set to NULL otherwise (i.e when none are currently running).
835  now等于rq_clock_task(rq_of(cfs_rq))
838  如果此条件成立可能性小(为编译器优化)(!curr)则返回
841  delta_exec等于nowexec_start
842  如果此条件成立可能性小(为编译器优化)((s64)delta_exec <= 0)则返回
845  exec_start等于now
847  schedstat_set(exec_max, 两数取大(delta_exec, exec_max))
850  sum_exec_runtime加等于delta_exec
851  schedstat_add(exec_clock, delta_exec)
853  vruntime加等于delta /= w
854  update_min_vruntime(cfs_rq)
856  如果entity_is_task(curr)则
857  curtask等于CFS operations on generic schedulable entities:
859  trace_sched_stat_runtime(curtask, delta_exec, vruntime)
860  cgroup_account_cputime(curtask, delta_exec)
861  account_group_exec_runtime - Maintain exec runtime for a thread group
864  account_cfs_rq_runtime(cfs_rq, delta_exec)
调用者
名称描述
update_curr_fair
reweight_entity
enqueue_entityMIGRATION* dequeue* update_curr()* update_min_vruntime()* vruntime -= min_vruntime* enqueue* update_curr()* update_min_vruntime()* vruntime += min_vruntime* this way the vruntime transition between RQs is done when both* min_vruntime are up-to-date
dequeue_entity
put_prev_entity
entity_tick更新当前进程运行时间,并判断是否需要调度此进程
check_preempt_wakeupPreempt the current task with a newly woken task if needed:
yield_task_fairsched_yield() is very simple* The magic of dealing with the ->skip buddy is in pick_next_entity.
task_fork_fairalled on fork with the child task as argument from the parent's context* - child not yet on the tasklist* - preemption disabled