Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\fair.c Create Date:2022-07-28 09:38:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Update the current task's runtime statistics.

Proto:static void update_curr(struct cfs_rq *cfs_rq)

Type:void

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(!curr) Then Return
841  delta_exec = now - exec_start
842  If Value for the false possibility is greater at compile time((s64)delta_exec <= 0) Then Return
845  exec_start = now
847  schedstat_set(exec_max, max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(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  If entity_is_task(curr) Then
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)
Caller
NameDescribe
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