Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\stop_machine.c Create Date:2022-07-28 11:20:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This is the cpu_stop function which stops the CPU.

Proto:static int multi_cpu_stop(void *data)

Type:int

Parameter:

TypeParameterName
void *data
189  msdata = data
190  curstate = MULTI_STOP_NONE
191  cpu = smp_processor_id() , err = 0
200  local_save_flags(flags)
202  If Not active_cpus Then
203  cpumask = cpu_online_mask
204  is_active = cpu == Uniprocessor. Assume all masks are "1".
205  Else
206  cpumask = active_cpus
207  is_active = pumask_test_cpu - test for a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@cpumask: the cpumask pointer* Returns 1 if @cpu is set in @cpumask, else returns 0
211  Do
213  stop_machine_yield(cpumask)
214  newstate = READ_ONCE(state)
215  If newstate != curstate Then
216  curstate = newstate
222  Case curstate == MULTI_STOP_RUN
223  If is_active Then err = fn(data)
225  Break
226  Default
227  Break
230  Else if curstate > MULTI_STOP_PREPARE Then
238  Let the RCU core know that this CPU has gone through the scheduler,* which is a quiescent state
239  When curstate != MULTI_STOP_EXIT cycle
241  local_irq_restore(flags)
242  Return err
Caller
NameDescribe
stop_machine_from_inactive_cpustop_machine_from_inactive_cpu - stop_machine() from inactive CPU*@fn: the function to run*@data: the data ptr for the @fn()*@cpus: the cpus to run the @fn() on (NULL = any online cpu)* This is identical to stop_machine() but can be called from a CPU which