Re: BUG: spinlock bad magic on CPU#0, migration/0/9

From: Oleg Nesterov
Date: Thu Feb 12 2015 - 14:41:28 EST


On 02/12, Nicholas Mc Guire wrote:
>
> On Thu, 12 Feb 2015, Oleg Nesterov wrote:
>
> > --- x/kernel/sched/completion.c
> > +++ x/kernel/sched/completion.c
> > @@ -274,7 +274,7 @@ bool try_wait_for_completion(struct comp
> > * first without taking the lock so we can
> > * return early in the blocking case.
> > */
> > - if (!ACCESS_ONCE(x->done))
> > + if (!READ_ONCE(x->done))
> > return 0;
> >
> from looking at compiler.h I don't think that there would be a difference
> between ACCESS_ONCE() and READ_ONCE() in this case

Yes, this is unrelated "while at it" cosmetic change, now that we have
READ_ONCE() it makes more sense in this case.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/