Messages in this thread | | | Date | Fri, 28 Feb 2014 13:26:24 +0100 | From | Peter Zijlstra <> | Subject | Re: smp_call_function_single with wait=0 considered harmful |
| |
On Wed, Dec 04, 2013 at 08:46:27AM -0800, Christoph Hellwig wrote: > While doing my recent work on the generic smp function calls I noticed > that smp_call_function_single without the wait flag can't work, as > it allocates struct call_single_data on stack, and without the wait > flag will happily return before the IPI has been executed.
It doesn't actually; it uses a per-cpu one in the !wait case.
The subsequent csd_lock() ensures it will wait for any prior user to complete, so only if you're doing multiple smp_call_function_single() invocations back-to-back will they queue up.
> This affects the following callers:
<snip>
> kernel/stop_machine.c:stop_two_cpus()
That site should work with .wait=1 just fine, but given the above, the .wait=0 doesn't appear problematic at all.
| |