lkml.org 
[lkml]   [2019]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH-tip v3 06/11] locking/rwsem: Enhance DEBUG_RWSEMS_WARN_ON() macro
From
Date
On 04/03/2019 09:09 AM, Peter Zijlstra wrote:
> On Thu, Feb 28, 2019 at 02:09:36PM -0500, Waiman Long wrote:
>> diff --git a/kernel/locking/rwsem.h b/kernel/locking/rwsem.h
>> index 1d8f722..c8fd3f1 100644
>> --- a/kernel/locking/rwsem.h
>> +++ b/kernel/locking/rwsem.h
>> @@ -27,9 +27,13 @@
>> #define RWSEM_ANONYMOUSLY_OWNED (1UL << 1)
>>
>> #ifdef CONFIG_DEBUG_RWSEMS
>> -# define DEBUG_RWSEMS_WARN_ON(c) DEBUG_LOCKS_WARN_ON(c)
>> +# define DEBUG_RWSEMS_WARN_ON(c, sem) \
>> + WARN_ONCE(c, "DEBUG_RWSEMS_WARN_ON(%s): count = 0x%lx, owner = 0x%lx, curr 0x%lx, list %sempty\n",\
>> + #c, atomic_long_read(&(sem)->count), \
>> + (long)((sem)->owner), (long)current, \
>> + list_empty(&(sem)->wait_list) ? "" : "not ")
> This changes DEBUG_LOCKS_WARN_ON() to WARN_ONCE(), the difference being
> that you now fail to kill lockdep on a rwsem error, which seems
> unfortunate.
>
>> #else
>> -# define DEBUG_RWSEMS_WARN_ON(c)
>> +# define DEBUG_RWSEMS_WARN_ON(c, sem)
>> #endif

Yes, you are right. I will update my patch to fix that.

Cheers,
Longman

\
 
 \ /
  Last update: 2019-04-03 17:33    [W:0.097 / U:2.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site