Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The dequeue_task method is called before nr_running is* decreased. We remove the task from the rbtree and* update the fair scheduling stats:

Proto:static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)

Type:void

Parameter:

TypeParameterName
struct rq *rq
struct task_struct *p
intflags
5310  se = se
5311  task_sleep = flags & {de,en}queue flags:* DEQUEUE_SLEEP - task is no longer runnable* ENQUEUE_WAKEUP - task just became runnable* SAVE/RESTORE - an otherwise spurious dequeue/enqueue, done to ensure tasks* are in a known state which allows modification. Such pairs
5312  idle_h_nr_running = task_has_idle_policy(p)
5315  cfs_rq = cfs_rq_of(se)
5316  dequeue_entity(cfs_rq, se, flags)
5324  If cfs_rq_throttled(cfs_rq) Then Break
5326  SCHED_{NORMAL,BATCH,IDLE} --
5327  SCHED_IDLE -= idle_h_nr_running
5330  If weight Then
5332  se = parent_entity(se)
5337  If task_sleep && se && Not throttled_hierarchy(cfs_rq) Then set_next_buddy(se)
5339  Break
5341  flags |= {de,en}queue flags:* DEQUEUE_SLEEP - task is no longer runnable* ENQUEUE_WAKEUP - task just became runnable* SAVE/RESTORE - an otherwise spurious dequeue/enqueue, done to ensure tasks* are in a known state which allows modification. Such pairs
5345  cfs_rq = cfs_rq_of(se)
5346  SCHED_{NORMAL,BATCH,IDLE} --
5347  SCHED_IDLE -= idle_h_nr_running
5349  If cfs_rq_throttled(cfs_rq) Then Break
5352  update_load_avg(cfs_rq, se, UPDATE_TG)
5353  update_cfs_group(se)
5356  If Not se Then sub_nr_running(rq, 1)
5359  util_est_dequeue( & cfs, p, task_sleep)
5360  hrtick_update(rq)