函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:调度器

函数原型:static void __sched notrace __schedule(bool preempt)

返回类型:void

参数:

类型参数名称
boolpreempt
4014  cpu等于当前cpu ID()
4015  rq等于cpu_rq(cpu)
4016  prev等于当前任务
4018  调试检查和统计
4020  如果sched_feat(HRTICK)则清除高精度任务
4023  禁止中断()
4024  Note a PREEMPT=n context switch. The caller must have disabled interrupts.
4034  rq_lock(rq, & rf)
4035  smp_mb__after_spinlock() provides the equivalent of a full memory barrier* between program-order earlier lock acquisitions and program-order later* memory accesses()
4038  clock_update_flags左移等于1位
4039  更新rq运行时间
4041  switch_count等于上下文切换计数
4042  如果非preempt任务状态
4044  任务状态等于就绪态
4045  否则
4046  删除进程
4048  如果in_iowait
4053  switch_count等于切换计数
4056  next等于选择下一个要运行的进程
4057  清除调度位
4058  清除CPU的内核抢占
4060  如果此条件成立可能性大(为编译器优化)(prev != next)则
4061  切换计数器自加
4066  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers(当前任务, next)
4081  switch_count先自加
4083  Tracepoint for task switches, performed by the scheduler:
4086  rq等于进程切换
4087  否则
4088  clock_update_flags与等于RQCF_ACT_SKIP按位或q::clock_update_flags bits* %RQCF_REQ_SKIP - will request skipping of clock update on the next* call to __schedule(). This is an optimisation to avoid* neighbouring rq clock updates.* %RQCF_ACT_SKIP - is set from inside of __schedule() when skipping is的值的反
4089  rq_unlock_irq(rq, & rf)
4092  负载均衡配置
调用者
名称描述
do_task_dead
schedule进程调度
schedule_idlesynchronize_rcu_tasks() makes sure that no task is stuck in preempted* state (have scheduled out non-voluntarily) by making sure that all* tasks have either left the run queue or have gone into user space
preempt_schedule_common
preempt_schedule_irqThis is the entry point to schedule() from kernel preemption* off of irq context.* Note, that this is called and return with irqs disabled. This will* protect us against recursive calling from irq.