函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-27 10:36:03
Last Modify:2022-05-22 13:40:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:更新rq运行时间

函数原型:void update_rq_clock(struct rq *rq)

返回类型:void

参数:

类型参数名称
struct rq *rq
204  lockdep_assert_held( & 运行队列锁)
206  如果clock_update_flags按位与RQCF_ACT_SKIP则返回
215  delta等于sched_clock_cpu(根据rq获取CPU)减clock
216  如果delta小于0则返回
218  clock加等于delta
219  RQ-clock updating methods:
调用者
名称描述
enqueue_task
dequeue_task
ttwu_remoteCalled in case the task @p isn't fully descheduled from its runqueue,* in this case we must do a remote wakeup. Its a 'light' wakeup though,* since all we need to do is flip p->state to TASK_RUNNING, since* the task is still ->on_rq.
ttwu_queue
wake_up_new_taskwake_up_new_task - wake up a newly created task for the first time.* This function will do some initial scheduler statistics housekeeping* that must be done for every newly created context, then puts the task* on the runqueue and wakes it.
task_sched_runtimeReturn accounted runtime for the task.* In case the task is currently running, return the runtime plus current's* pending runtime that have not been accounted yet.
scheduler_tickThis function gets called by the timer code, with HZ frequency.* We call it with interrupts disabled.
__schedule调度器
set_user_nice
__sched_setscheduler
yield_task_fairsched_yield() is very simple* The magic of dealing with the ->skip buddy is in pick_next_entity.
task_fork_fairalled on fork with the child task as argument from the parent's context* - child not yet on the tasklist* - preemption disabled
do_sched_rt_period_timer
dl_task_timerThis is the bandwidth enforcement timer callback
inactive_task_timer
yield_task_dlYield task semantic for -deadline tasks is:* get off from the CPU until our next instance, with* a new runtime