Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:We must be sure that accepting a new task (or allowing changing the* parameters of an existing one) is consistent with the bandwidth* constraints. If yes, this function also accordingly updates the currently

Proto:int sched_dl_overflow(struct task_struct *p, int policy, const struct sched_attr *attr)

Type:int

Parameter:

TypeParameterName
struct task_struct *p
intpolicy
const struct sched_attr *attr
2552  dl_b = dl_bw_of(task_cpu(p))
2553  period = If sched_period Else sched_deadline
2554  runtime = SCHED_DEADLINE
2555  new_bw = If dl_policy(policy) Then to_ratio(period, runtime) Else 0
2556  err = -1
2558  If sched_flags & !! For sched_setattr_nocheck() (kernel) only !!* This is actually gross. :(* It is used to make schedutil kworker(s) higher priority than SCHED_DEADLINE* tasks, but still be able to sleep. We need this on platforms that cannot Then Return 0
2562  If new_bw == dl_runtime / dl_period && task_has_dl_policy(p) Then Return 0
2570  raw_spin_lock( & lock)
2571  cpus = dl_bw_cpus(task_cpu(p))
2572  If dl_policy(policy) && Not task_has_dl_policy(p) && Not __dl_overflow(dl_b, cpus, 0, new_bw) Then
2574  If hrtimer_active( & * Inactive timer, responsible for decreasing the active utilization * at the "0-lag time". When a -deadline task blocks, it contributes * to GRUB's active utilization until the "0-lag time", hence a * timer is needed to decrease the active utilization at t) Then __dl_sub(dl_b, dl_runtime / dl_period , cpus)
2576  __dl_add(dl_b, new_bw, cpus)
2577  err = 0
2578  Else if dl_policy(policy) && task_has_dl_policy(p) && Not __dl_overflow(dl_b, cpus, dl_runtime / dl_period , new_bw) Then
2587  __dl_sub(dl_b, dl_runtime / dl_period , cpus)
2588  __dl_add(dl_b, new_bw, cpus)
2589  dl_change_utilization(p, new_bw)
2590  err = 0
2591  Else if Not dl_policy(policy) && task_has_dl_policy(p) Then
2597  err = 0
2599  raw_spin_unlock( & lock)
2601  Return err
Caller
NameDescribe
__sched_setscheduler