函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:_idle - set up an idle thread for a given CPU*@idle: task in question*@cpu: CPU the idle task belongs to* NOTE: this function does not set the idle thread's NEED_RESCHED* flag, to make booting more robust.

函数原型:void init_idle(struct task_struct *idle, int cpu)

返回类型:void

参数:

类型参数名称
struct task_struct *idle
intcpu
6034  rq等于cpu_rq(cpu)
6037  Perform scheduler related setup for a newly forked process p.* p is forked by current.* __sched_fork() is basic setup used by init_idle() too:
6039  raw_spin_lock_irqsave( & Protection of the PI data structures: , flags)
6040  raw_spin_lock( & 运行队列锁)
6042  任务状态等于就绪态
6043  exec_start等于sched_clock()
6044  任务标志或等于I am an IDLE thread
6046  kasan_unpoison_task_stack(idle)
6067  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
6068  __set_task_cpu(idle, cpu)
6069  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
6071  空闲任务等于idle
6072  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(当前任务, idle)
6073  归属队列等于ask_struct::on_rq states:
6077  raw_spin_unlock( & 运行队列锁)
6078  raw_spin_unlock_irqrestore( & Protection of the PI data structures: , flags)
6081  init_idle_preempt_count(idle, cpu)
6086  调度函数等于idle_sched_class
6087  ftrace_graph_init_idle_task(idle, cpu)
6088  vtime_init_idle(idle, cpu)
调用者
名称描述
sched_init初始化调度器数据结构并创建运行队列
fork_idle