[Linaro-mm-sig] [PATCH v4 3/4] mutex: Add ww tests to lib/locking-selftest.c. v4
Daniel Vetter
daniel.vetter at ffwll.ch
Wed May 29 00:22:41 PDT 2013
On Tue, May 28, 2013 at 11:12 PM, Maarten Lankhorst
<maarten.lankhorst at canonical.com> 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
More information about the dri-devel
mailing list