Lines Matching refs:cpu
30 struct task_struct *idle_thread_get(unsigned int cpu) in idle_thread_get() argument
32 struct task_struct *tsk = per_cpu(idle_threads, cpu); in idle_thread_get()
50 static __always_inline void idle_init(unsigned int cpu) in idle_init() argument
52 struct task_struct *tsk = per_cpu(idle_threads, cpu); in idle_init()
55 tsk = fork_idle(cpu); in idle_init()
57 pr_err("SMP: fork_idle() failed for CPU %u\n", cpu); in idle_init()
59 per_cpu(idle_threads, cpu) = tsk; in idle_init()
68 unsigned int cpu, boot_cpu; in idle_threads_init() local
72 for_each_possible_cpu(cpu) { in idle_threads_init()
73 if (cpu != boot_cpu) in idle_threads_init()
74 idle_init(cpu); in idle_threads_init()
85 unsigned int cpu; member
119 ht->cleanup(td->cpu, cpu_online(td->cpu)); in smpboot_thread_fn()
128 BUG_ON(td->cpu != smp_processor_id()); in smpboot_thread_fn()
129 ht->park(td->cpu); in smpboot_thread_fn()
137 BUG_ON(td->cpu != smp_processor_id()); in smpboot_thread_fn()
145 ht->setup(td->cpu); in smpboot_thread_fn()
153 ht->unpark(td->cpu); in smpboot_thread_fn()
158 if (!ht->thread_should_run(td->cpu)) { in smpboot_thread_fn()
164 ht->thread_fn(td->cpu); in smpboot_thread_fn()
170 __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu) in __smpboot_create_thread() argument
172 struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); in __smpboot_create_thread()
178 td = kzalloc_node(sizeof(*td), GFP_KERNEL, cpu_to_node(cpu)); in __smpboot_create_thread()
181 td->cpu = cpu; in __smpboot_create_thread()
184 tsk = kthread_create_on_cpu(smpboot_thread_fn, td, cpu, in __smpboot_create_thread()
190 kthread_set_per_cpu(tsk, cpu); in __smpboot_create_thread()
197 *per_cpu_ptr(ht->store, cpu) = tsk; in __smpboot_create_thread()
208 ht->create(cpu); in __smpboot_create_thread()
213 int smpboot_create_threads(unsigned int cpu) in smpboot_create_threads() argument
220 ret = __smpboot_create_thread(cur, cpu); in smpboot_create_threads()
228 static void smpboot_unpark_thread(struct smp_hotplug_thread *ht, unsigned int cpu) in smpboot_unpark_thread() argument
230 struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); in smpboot_unpark_thread()
236 int smpboot_unpark_threads(unsigned int cpu) in smpboot_unpark_threads() argument
242 smpboot_unpark_thread(cur, cpu); in smpboot_unpark_threads()
247 static void smpboot_park_thread(struct smp_hotplug_thread *ht, unsigned int cpu) in smpboot_park_thread() argument
249 struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); in smpboot_park_thread()
255 int smpboot_park_threads(unsigned int cpu) in smpboot_park_threads() argument
261 smpboot_park_thread(cur, cpu); in smpboot_park_threads()
268 unsigned int cpu; in smpboot_destroy_threads() local
271 for_each_possible_cpu(cpu) { in smpboot_destroy_threads()
272 struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); in smpboot_destroy_threads()
276 *per_cpu_ptr(ht->store, cpu) = NULL; in smpboot_destroy_threads()
290 unsigned int cpu; in smpboot_register_percpu_thread() local
295 for_each_online_cpu(cpu) { in smpboot_register_percpu_thread()
296 ret = __smpboot_create_thread(plug_thread, cpu); in smpboot_register_percpu_thread()
301 smpboot_unpark_thread(plug_thread, cpu); in smpboot_register_percpu_thread()