[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190403130934.GH4038@hirez.programming.kicks-ass.net>
Date: Wed, 3 Apr 2019 15:09:34 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Waiman Long <longman@...hat.com>
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 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
Powered by blists - more mailing lists