[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd62f507-e955-8e92-7c95-9fd2583083f6@redhat.com>
Date: Wed, 3 Apr 2019 11:33:30 -0400
From: Waiman Long <longman@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will.deacon@....com>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, x86@...nel.org,
Arnd Bergmann <arnd@...db.de>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Davidlohr Bueso <dave@...olabs.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Tim Chen <tim.c.chen@...ux.intel.com>
Subject: Re: [PATCH-tip v3 06/11] locking/rwsem: Enhance
DEBUG_RWSEMS_WARN_ON() macro
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
Powered by blists - more mailing lists