Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\deadline.c Create Date:2022-07-28 09:40:09
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 (provided it is still* a -deadline task and has not been removed from the dl_rq).

Proto:static void update_curr_dl(struct rq *rq)

Type:void

Parameter:

TypeParameterName
struct rq *rq
1181  curr = curr
1182  dl_se = dl
1184  cpu = cpu_of(rq)
1187  If Not dl_task(curr) || Not on_dl_rq(dl_se) Then Return
1198  now = rq_clock_task(rq)
1199  delta_exec = now - exec_start
1200  If Value for the false possibility is greater at compile time((s64)delta_exec <= 0) Then
1201  If Value for the false possibility is greater at compile time(dl_yielded) Then Go to throttle
1203  Return
1206  schedstat_set(exec_max, max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(exec_max, delta_exec))
1209  sum_exec_runtime += delta_exec
1210  account_group_exec_runtime - Maintain exec runtime for a thread group
1212  exec_start = now
1213  cgroup_account_cputime(curr, delta_exec)
1215  If dl_entity_is_special(dl_se) Then Return
1225  If Value for the false possibility is greater at compile time( Specifying the scheduler behaviour & SCHED_FLAG_RECLAIM) Then
1226  scaled_delta_exec = This function implements the GRUB accounting rule:* according to the GRUB reclaiming algorithm, the runtime is* not decreased as "dq = -dt", but as* "dq = -max{u / Umax, (1 - Uinact - Uextra)} dt",* where u is the utilization of the task, Umax is the
1229  Else
1230  scale_freq = arch_scale_freq_capacity(cpu)
1231  scale_cpu = arch_scale_cpu_capacity(cpu)
1233  scaled_delta_exec = cap_scale(delta_exec, scale_freq)
1234  scaled_delta_exec = cap_scale(scaled_delta_exec, scale_cpu)
1237  Remaining runtime for this instance -= scaled_delta_exec
1239  throttle :
1240  If dl_runtime_exceeded(dl_se) || dl_yielded Then
1241  * Some bool flags: *@dl_throttled tells if we exhausted the runtime. If so, the * task has to wait for a replenishment to be performed at the * next firing of dl_timer. *@dl_boosted tells if we are boosted due to DI. If so we are * outside bandwidth enforc = 1
1244  If dl_runtime_exceeded(dl_se) && Specifying the scheduler behaviour & SCHED_FLAG_DL_OVERRUN Then dl_overrun = 1
1248  __dequeue_task_dl(rq, curr, 0)
1249  If Value for the false possibility is greater at compile time(dl_boosted || !If the entity depleted all its runtime, and if we want it to sleep* while waiting for some new execution time to become available, we* set the bandwidth replenishment timer to the replenishment instant* and try to activate it) Then enqueue_task_dl(rq, curr, ENQUEUE_REPLENISH)
1252  If Not is_leftmost(curr, & dl) Then 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.
1267  If rt_bandwidth_enabled() Then
1268  rt_rq = rt
1270  raw_spin_lock( & Nests inside the rq lock: )
1276  If sched_rt_bandwidth_account(rt_rq) Then rt_time += delta_exec
1278  raw_spin_unlock( & Nests inside the rq lock: )
Caller
NameDescribe
dequeue_task_dl
yield_task_dlYield task semantic for -deadline tasks is:* get off from the CPU until our next instance, with* a new runtime
put_prev_task_dl
task_tick_dlscheduler tick hitting a task of our scheduling class