Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Preempt the current task with a newly woken task if needed:

Proto:static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_flags)

Type:void

Parameter:

TypeParameterName
struct rq *rq
struct task_struct *p
intwake_flags
6565  curr = curr
6566  se = se , pse = se
6567  cfs_rq = task_cfs_rq(curr)
6568  scale = nr_running >= This value is kept at sysctl_sched_latency/sysctl_sched_min_granularity
6569  next_buddy_marked = 0
6571  If Value for the false possibility is greater at compile time(se == pse) Then Return
6580  If Value for the false possibility is greater at compile time(throttled_hierarchy(cfs_rq_of(pse))) Then Return
6583  If sched_feat(NEXT_BUDDY) && scale && Not (wake_flags & Child wakeup after fork ) Then
6584  set_next_buddy(pse)
6585  next_buddy_marked = 1
6598  If test_tsk_need_resched(curr) Then Return
6602  If Value for the false possibility is greater at compile time(task_has_idle_policy(curr)) && Value is more likely to compile time(!task_has_idle_policy(p)) Then Go to preempt
6610  If Value for the false possibility is greater at compile time(policy != Scheduling policies) || Not sched_feat(WAKEUP_PREEMPTION) Then Return
6613  find_matching_se( & se, & pse)
6614  Update the current task's runtime statistics.
6615  BUG_ON(!pse)
6616  If wakeup_preempt_entity(se, pse) == 1 Then
6621  If Not next_buddy_marked Then set_next_buddy(pse)
6623  Go to preempt
6626  Return
6628  preempt :
6629  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.
6639  If Value for the false possibility is greater at compile time(!on_rq || curr == idle) Then Return
6642  If sched_feat(LAST_BUDDY) && scale && entity_is_task(se) Then set_last_buddy(se)