Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smpboot_thread_fn - percpu hotplug thread loop function*@data: thread data pointer* Checks for thread stop and park conditions. Calls the necessary* setup, cleanup, park and unpark functions for the registered* thread.

Proto:static int smpboot_thread_fn(void *data)

Type:int

Parameter:

TypeParameterName
void *data
109  td = data
110  ht = ht
112  When 1 cycle
113  set_current_state(TASK_INTERRUPTIBLE)
114  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.()
117  preempt_enable()
122  Return 0
127  preempt_enable()
128  If park && status == HP_THREAD_ACTIVE Then
133  kthread_parkme()
135  Continue
138  BUG_ON(cpu != smp_processor_id())
142  Case status == HP_THREAD_NONE
144  preempt_enable()
145  If setup Then setup(cpu)
148  Continue
150  Case status == HP_THREAD_PARKED
152  preempt_enable()
153  If unpark Then unpark(cpu)
156  Continue
159  If Not thread_should_run(cpu) Then
161  schedule()
162  Else
164  preempt_enable()
165  thread_fn(cpu)