[ Added Frederic to the cc, since he's touched this file/area most ] On Wed, Feb 11, 2015 at 11:59 AM, Linus Torvalds wrote: > > So the caller has a really hard time guaranteeing that CSD_LOCK isn't > set. And if the call is done in interrupt context, for all we know it > is interrupting the code that is going to clear CSD_LOCK, so CSD_LOCK > will never be cleared at all, and csd_lock() will wait forever. > > So I actually think that for the async case, we really *should* unlock > before doing the callback (which is what Thomas' old patch did). > > And we migth well be better off doing something like > > WARN_ON_ONCE(csd->flags & CSD_LOCK); > > in smp_call_function_single_async(), because that really is a hard requirement. > > And it strikes me that hrtick_csd is one of these cases that do this > with interrupts disabled, and use the callback for serialization. So I > really wonder if this is part of the problem.. > > Thomas? Am I missing something? Ok, this is a more involved patch than I'd like, but making the *caller* do all the CSD maintenance actually cleans things up. And this is still completely untested, and may be entirely buggy. What do you guys think? Linus