Lines Matching refs:csd
26 struct call_single_data __percpu *csd; member
48 cfd->csd = alloc_percpu(struct call_single_data); in hotplug_cfd()
49 if (!cfd->csd) { in hotplug_cfd()
63 free_percpu(cfd->csd); in hotplug_cfd()
108 static void csd_lock_wait(struct call_single_data *csd) in csd_lock_wait() argument
110 while (smp_load_acquire(&csd->flags) & CSD_FLAG_LOCK) in csd_lock_wait()
114 static void csd_lock(struct call_single_data *csd) in csd_lock() argument
116 csd_lock_wait(csd); in csd_lock()
117 csd->flags |= CSD_FLAG_LOCK; in csd_lock()
127 static void csd_unlock(struct call_single_data *csd) in csd_unlock() argument
129 WARN_ON(!(csd->flags & CSD_FLAG_LOCK)); in csd_unlock()
134 smp_store_release(&csd->flags, 0); in csd_unlock()
144 static int generic_exec_single(int cpu, struct call_single_data *csd, in generic_exec_single() argument
154 csd_unlock(csd); in generic_exec_single()
163 csd_unlock(csd); in generic_exec_single()
167 csd->func = func; in generic_exec_single()
168 csd->info = info; in generic_exec_single()
181 if (llist_add(&csd->llist, &per_cpu(call_single_queue, cpu))) in generic_exec_single()
216 struct call_single_data *csd, *csd_next; in flush_smp_call_function_queue() local
235 llist_for_each_entry(csd, entry, llist) in flush_smp_call_function_queue()
237 csd->func); in flush_smp_call_function_queue()
240 llist_for_each_entry_safe(csd, csd_next, entry, llist) { in flush_smp_call_function_queue()
241 smp_call_func_t func = csd->func; in flush_smp_call_function_queue()
242 void *info = csd->info; in flush_smp_call_function_queue()
245 if (csd->flags & CSD_FLAG_SYNCHRONOUS) { in flush_smp_call_function_queue()
247 csd_unlock(csd); in flush_smp_call_function_queue()
249 csd_unlock(csd); in flush_smp_call_function_queue()
274 struct call_single_data *csd; in smp_call_function_single() local
294 csd = &csd_stack; in smp_call_function_single()
296 csd = this_cpu_ptr(&csd_data); in smp_call_function_single()
297 csd_lock(csd); in smp_call_function_single()
300 err = generic_exec_single(cpu, csd, func, info); in smp_call_function_single()
303 csd_lock_wait(csd); in smp_call_function_single()
327 int smp_call_function_single_async(int cpu, struct call_single_data *csd) in smp_call_function_single_async() argument
334 if (WARN_ON_ONCE(csd->flags & CSD_FLAG_LOCK)) in smp_call_function_single_async()
335 csd_lock_wait(csd); in smp_call_function_single_async()
337 csd->flags = CSD_FLAG_LOCK; in smp_call_function_single_async()
340 err = generic_exec_single(cpu, csd, csd->func, csd->info); in smp_call_function_single_async()
449 struct call_single_data *csd = per_cpu_ptr(cfd->csd, cpu); in smp_call_function_many() local
451 csd_lock(csd); in smp_call_function_many()
453 csd->flags |= CSD_FLAG_SYNCHRONOUS; in smp_call_function_many()
454 csd->func = func; in smp_call_function_many()
455 csd->info = info; in smp_call_function_many()
456 llist_add(&csd->llist, &per_cpu(call_single_queue, cpu)); in smp_call_function_many()
464 struct call_single_data *csd; in smp_call_function_many() local
466 csd = per_cpu_ptr(cfd->csd, cpu); in smp_call_function_many()
467 csd_lock_wait(csd); in smp_call_function_many()