Re: sched: spinlock recursion in sched_rr_get_interval

From: Sasha Levin
Date: Sat Dec 27 2014 - 10:54:43 EST


On 12/27/2014 04:52 AM, Davidlohr Bueso wrote:
>> Helloï
>> > Does ACCESS_ONCE() can help this issue? I have no evidence that its lack is
>> > responsible for the issue, but I think here need it indeed. Is that right?
>> >
>> > SPIN_BUG_ON(ACCESS_ONCE(lock->owner) == current, "recursion");
> Hmm I guess on a contended spinlock, there's a chance that lock->owner
> can change, if the contended lock is acquired, right between the 'cond'
> and spin_debug(), which would explain the bogus ->owner related
> messages. Of course the same applies to ->owner_cpu. Your ACCESS_ONCE,
> however, doesn't really change anything since we still read ->owner
> again in spin_debug; How about something like this (untested)?

There's a chance that lock->owner would change, but how would you explain
it changing to 'current'?

That is, what race condition specifically creates the
'lock->owner == current' situation in the debug check?

Thanks,
Sasha
--
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/