Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:alled on fork with the child task as argument from the parent's context* - child not yet on the tasklist* - preemption disabled

Proto:static void task_fork_fair(struct task_struct *p)

Type:void

Parameter:

TypeParameterName
struct task_struct *p
10301  se = se
10302  rq = this_rq()
10305  rq_lock(rq, & rf)
10306  update_rq_clock(rq)
10308  cfs_rq = task_cfs_rq(current process)
10309  curr = 'curr' points to currently running entity on this cfs_rq.* It is set to NULL otherwise (i.e when none are currently running).
10310  If curr Then
10311  Update the current task's runtime statistics.
10312  vruntime = vruntime
10314  place_entity(cfs_rq, se, 1)
10316  If After fork, child runs first. If set to 0 (default) then* parent will (try to) run first. && curr && entity_before(curr, se) Then
10321  swap - swap values of @a and @b*@a: first value*@b: second value(vruntime, vruntime)
10322  sched_curr - mark rq's current task 'to be rescheduled now'.* On UP this means the setting of the need_resched flag, on SMP it* might also involve a cross-CPU call to trigger the scheduler on* the target CPU.
10325  vruntime -= min_vruntime
10326  rq_unlock(rq, & rf)