[lkml]   [2015]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: BUG: spinlock bad magic on CPU#0, migration/0/9
On 02/14, Nicholas Mc Guire wrote:
> Basically if you call wait_for_completion_timeout and the timeout condition
> occures you always need some way of notifying the completing end that it
> should no longer call complete()/complete_all().

Sure. "struct completion" doesn't differ from any other object when it comes
to use-after-free.

> > OK, perhaps you can ack the fix I sent?
> the only question I still have is that there would be no matching
> smp_wmb() to the smp_rmb() you are using (atleast I did not figure out where).

You seem to assume that every rmb() must be paired with wmb(). This is not
always true.

But as for completion_done(), its rmb() pairs with "release" semantics of
complete()->spin_unlock(), which is a "one way" barrier.


 \ /
  Last update: 2015-02-14 15:21    [W:0.039 / U:3.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site