Re: [Linaro-mm-sig] [PATCH v4 3/4] mutex: Add ww tests tolib/locking-selftest.c. v4

From: Daniel Vetter
Date: Wed May 29 2013 - 03:22:48 EST


On Tue, May 28, 2013 at 11:12 PM, Maarten Lankhorst
<maarten.lankhorst@xxxxxxxxxxxxx> wrote:
>>> +static void ww_test_spin_nest_unlocked(void)
>>> +{
>>> + raw_spin_lock_nest_lock(&lock_A, &o.base);
>>> + U(A);
>>> +}
>> I don't quite see the point of this one here ...
> It's a lockdep test that was missing. o.base is not locked. So lock_A is being nested into an unlocked lock, resulting in a lockdep error.

Sounds like a different patch then ...

>>> +
>>> +static void ww_test_unneeded_slow(void)
>>> +{
>>> + int ret;
>>> +
>>> + WWAI(&t);
>>> +
>>> + ww_mutex_lock_slow(&o, &t);
>>> +}
>> I think checking the _slow debug stuff would be neat, i.e.
>> - fail/success tests for properly unlocking all held locks
>> - fail/success tests for lock_slow acquiring the right lock.
>>
>> Otherwise I didn't spot anything that seems missing in these self-tests
>> here.
>>
> Yes it would be nice, doing so is left as an excercise for the reviewer, who failed to raise this point sooner. ;-)

Hm, I guess I've volunteered myself to look into this a bit ;-)
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
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/