Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-28 09:37:09
Last Modify:2022-05-22 13:40:38 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:_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.

Proto:void init_idle(struct task_struct *idle, int cpu)

Type:void

Parameter:

TypeParameterName
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( & runqueue lock: )
6042  run state = Used in tsk->state:
6043  exec_start = sched_clock()
6044  Per task flags (PF_*), defined further below: |= 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 = 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(curr, idle)
6073  on_rq = ask_struct::on_rq states:
6077  raw_spin_unlock( & runqueue lock: )
6078  raw_spin_unlock_irqrestore( & Protection of the PI data structures: , flags)
6081  init_idle_preempt_count(idle, cpu)
6086  sched_class = idle_sched_class
6087  ftrace_graph_init_idle_task(idle, cpu)
6088  vtime_init_idle(idle, cpu)
Caller
NameDescribe
sched_init