Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:cpu_stop_queue_two_works

Proto:static int cpu_stop_queue_two_works(int cpu1, struct cpu_stop_work *work1, int cpu2, struct cpu_stop_work *work2)

Type:int

Parameter:

TypeParameterName
intcpu1
struct cpu_stop_work *work1
intcpu2
struct cpu_stop_work *work2
248  stopper1 = per_cpu_ptr( & cpu_stopper, cpu1)
249  stopper2 = per_cpu_ptr( & cpu_stopper, cpu2)
253  retry :
261  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
262  raw_spin_lock_irq( & lock)
263  raw_spin_lock_nested( & lock, For trivial one-depth nesting of a lock-class, the following* global define can be used. (Subsystems with multiple levels* of nesting should define their own lock-nesting subclasses.))
265  If Not s this stopper enabled? || Not s this stopper enabled? Then
266  err = -ENOENT
267  Go to unlock
280  If Value for the false possibility is greater at compile time(stop_cpus_in_progress) Then
281  err = -EDEADLK
282  Go to unlock
285  err = 0
286  __cpu_stop_queue_work(stopper1, work1, & wakeq)
287  __cpu_stop_queue_work(stopper2, work2, & wakeq)
289  unlock :
290  raw_spin_unlock( & lock)
291  raw_spin_unlock_irq( & lock)
293  If Value for the false possibility is greater at compile time(err == - EDEADLK) Then
294  preempt_enable()
296  When stop_cpus_in_progress cycle
297  cpu_relax()
299  Go to retry
302  wake_up_q( & wakeq)
303  preempt_enable()
305  Return err
Caller
NameDescribe
stop_two_cpusstop_two_cpus - stops two cpus*@cpu1: the cpu to stop*@cpu2: the other cpu to stop*@fn: function to execute*@arg: argument to @fn* Stops both the current and specified CPU and runs @fn on one of them.* returns when both are completed.