Messages in this thread | | | Date | Mon, 19 May 2014 18:18:36 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH v5 UPDATEDv2 3/3] CPU hotplug, smp: Flush any pending IPI callbacks before CPU offline |
| |
On 05/19, Srivatsa S. Bhat wrote: > > However, an IPI sent much earlier might arrive late on the target CPU > (possibly _after_ the CPU has gone offline) due to hardware latencies, > and due to this, the smp-call-function callbacks queued on the outgoing > CPU might not get noticed (and hence not executed) at all.
OK, but
> +void flush_smp_call_function_queue(void) > +{ > + struct llist_head *head; > + struct llist_node *entry; > + struct call_single_data *csd, *csd_next; > + > + WARN_ON(!irqs_disabled()); > + > + head = &__get_cpu_var(call_single_queue); > + > + if (likely(llist_empty(head))) > + return; > + > + entry = llist_del_all(head); > + entry = llist_reverse_order(entry); > + > + llist_for_each_entry_safe(csd, csd_next, entry, llist) { > + csd->func(csd->info); > + csd_unlock(csd); > + } > +}
why do we need it? Can't multi_cpu_stop() just call generic_smp_call_function_single_interrupt() ? This cpu is still online, we should not worry about WARN_ON(!cpu_online()) ?
Oleg.
| |