* [PATCH] locking/lockdep: clean up #ifdef checks
@ 2019-06-28 10:29 Arnd Bergmann
2019-06-28 11:03 ` Will Deacon
2019-07-25 16:04 ` [tip:locking/core] locking/lockdep: Clean " tip-bot for Arnd Bergmann
0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-06-28 10:29 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Will Deacon
Cc: Arnd Bergmann, Andrew Morton, Bart Van Assche,
Frederic Weisbecker, Linus Torvalds, Paul E. McKenney,
Thomas Gleixner, Waiman Long, Will Deacon, Yuyang Du,
Ingo Molnar, linux-kernel
As Will Deacon points out, CONFIG_PROVE_LOCKING implies TRACE_IRQFLAGS,
so the conditions I added in the previous patch, and some others in the
same file can be simplified by only checking for the former.
No functional change.
Fixes: 886532aee3cd ("locking/lockdep: Move mark_lock() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
kernel/locking/lockdep.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 341f52117f88..4861cf8e274b 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -448,7 +448,7 @@ static void print_lockdep_off(const char *bug_msg)
unsigned long nr_stack_trace_entries;
-#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
+#ifdef CONFIG_PROVE_LOCKING
/*
* Stack-trace: tightly packed array of stack backtrace
* addresses. Protected by the graph_lock.
@@ -491,7 +491,7 @@ unsigned int max_lockdep_depth;
DEFINE_PER_CPU(struct lockdep_stats, lockdep_stats);
#endif
-#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
+#ifdef CONFIG_PROVE_LOCKING
/*
* Locking printouts:
*/
@@ -2969,7 +2969,7 @@ static void check_chain_key(struct task_struct *curr)
#endif
}
-#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
+#ifdef CONFIG_PROVE_LOCKING
static int mark_lock(struct task_struct *curr, struct held_lock *this,
enum lock_usage_bit new_bit);
@@ -3608,7 +3608,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
return ret;
}
-#else /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */
+#else /* CONFIG_PROVE_LOCKING */
static inline int
mark_usage(struct task_struct *curr, struct held_lock *hlock, int check)
@@ -3627,7 +3627,7 @@ static inline int separate_irq_context(struct task_struct *curr,
return 0;
}
-#endif /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */
+#endif /* CONFIG_PROVE_LOCKING */
/*
* Initialize a lock instance's lock-class mapping info:
@@ -4321,8 +4321,7 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie
*/
static void check_flags(unsigned long flags)
{
-#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) && \
- defined(CONFIG_TRACE_IRQFLAGS)
+#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP)
if (!debug_locks)
return;
--
2.20.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] locking/lockdep: clean up #ifdef checks
2019-06-28 10:29 [PATCH] locking/lockdep: clean up #ifdef checks Arnd Bergmann
@ 2019-06-28 11:03 ` Will Deacon
2019-07-01 8:23 ` Peter Zijlstra
2019-07-25 16:04 ` [tip:locking/core] locking/lockdep: Clean " tip-bot for Arnd Bergmann
1 sibling, 1 reply; 4+ messages in thread
From: Will Deacon @ 2019-06-28 11:03 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Peter Zijlstra, Ingo Molnar, Andrew Morton, Bart Van Assche,
Frederic Weisbecker, Linus Torvalds, Paul E. McKenney,
Thomas Gleixner, Waiman Long, Will Deacon, Yuyang Du,
Ingo Molnar, linux-kernel
Hi Arnd,
On Fri, Jun 28, 2019 at 12:29:03PM +0200, Arnd Bergmann wrote:
> As Will Deacon points out, CONFIG_PROVE_LOCKING implies TRACE_IRQFLAGS,
> so the conditions I added in the previous patch, and some others in the
> same file can be simplified by only checking for the former.
>
> No functional change.
>
> Fixes: 886532aee3cd ("locking/lockdep: Move mark_lock() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> kernel/locking/lockdep.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
Thanks for following up on this. I think it makes the code easier to read,
so:
Acked-by: Will Deacon <will@kernel.org>
Will
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] locking/lockdep: clean up #ifdef checks
2019-06-28 11:03 ` Will Deacon
@ 2019-07-01 8:23 ` Peter Zijlstra
0 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2019-07-01 8:23 UTC (permalink / raw)
To: Will Deacon
Cc: Arnd Bergmann, Ingo Molnar, Andrew Morton, Bart Van Assche,
Frederic Weisbecker, Linus Torvalds, Paul E. McKenney,
Thomas Gleixner, Waiman Long, Will Deacon, Yuyang Du,
Ingo Molnar, linux-kernel
On Fri, Jun 28, 2019 at 12:03:54PM +0100, Will Deacon wrote:
> Hi Arnd,
>
> On Fri, Jun 28, 2019 at 12:29:03PM +0200, Arnd Bergmann wrote:
> > As Will Deacon points out, CONFIG_PROVE_LOCKING implies TRACE_IRQFLAGS,
> > so the conditions I added in the previous patch, and some others in the
> > same file can be simplified by only checking for the former.
> >
> > No functional change.
> >
> > Fixes: 886532aee3cd ("locking/lockdep: Move mark_lock() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > kernel/locking/lockdep.c | 13 ++++++-------
> > 1 file changed, 6 insertions(+), 7 deletions(-)
>
> Thanks for following up on this. I think it makes the code easier to read,
> so:
>
> Acked-by: Will Deacon <will@kernel.org>
Thanks guys!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:locking/core] locking/lockdep: Clean up #ifdef checks
2019-06-28 10:29 [PATCH] locking/lockdep: clean up #ifdef checks Arnd Bergmann
2019-06-28 11:03 ` Will Deacon
@ 2019-07-25 16:04 ` tip-bot for Arnd Bergmann
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Arnd Bergmann @ 2019-07-25 16:04 UTC (permalink / raw)
To: linux-tip-commits
Cc: bvanassche, tglx, will, paulmck, mingo, akpm, duyuyang, torvalds,
frederic, linux-kernel, arnd, longman, hpa, peterz
Commit-ID: 30a35f79faadfeb1b89a7fdb3875f14063519041
Gitweb: https://git.kernel.org/tip/30a35f79faadfeb1b89a7fdb3875f14063519041
Author: Arnd Bergmann <arnd@arndb.de>
AuthorDate: Fri, 28 Jun 2019 12:29:03 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 25 Jul 2019 15:39:26 +0200
locking/lockdep: Clean up #ifdef checks
As Will Deacon points out, CONFIG_PROVE_LOCKING implies TRACE_IRQFLAGS,
so the conditions I added in the previous patch, and some others in the
same file can be simplified by only checking for the former.
No functional change.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <longman@redhat.com>
Cc: Yuyang Du <duyuyang@gmail.com>
Fixes: 886532aee3cd ("locking/lockdep: Move mark_lock() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING")
Link: https://lkml.kernel.org/r/20190628102919.2345242-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/locking/lockdep.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 341f52117f88..4861cf8e274b 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -448,7 +448,7 @@ static void print_lockdep_off(const char *bug_msg)
unsigned long nr_stack_trace_entries;
-#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
+#ifdef CONFIG_PROVE_LOCKING
/*
* Stack-trace: tightly packed array of stack backtrace
* addresses. Protected by the graph_lock.
@@ -491,7 +491,7 @@ unsigned int max_lockdep_depth;
DEFINE_PER_CPU(struct lockdep_stats, lockdep_stats);
#endif
-#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
+#ifdef CONFIG_PROVE_LOCKING
/*
* Locking printouts:
*/
@@ -2969,7 +2969,7 @@ static void check_chain_key(struct task_struct *curr)
#endif
}
-#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
+#ifdef CONFIG_PROVE_LOCKING
static int mark_lock(struct task_struct *curr, struct held_lock *this,
enum lock_usage_bit new_bit);
@@ -3608,7 +3608,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
return ret;
}
-#else /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */
+#else /* CONFIG_PROVE_LOCKING */
static inline int
mark_usage(struct task_struct *curr, struct held_lock *hlock, int check)
@@ -3627,7 +3627,7 @@ static inline int separate_irq_context(struct task_struct *curr,
return 0;
}
-#endif /* defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING) */
+#endif /* CONFIG_PROVE_LOCKING */
/*
* Initialize a lock instance's lock-class mapping info:
@@ -4321,8 +4321,7 @@ static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie
*/
static void check_flags(unsigned long flags)
{
-#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP) && \
- defined(CONFIG_TRACE_IRQFLAGS)
+#if defined(CONFIG_PROVE_LOCKING) && defined(CONFIG_DEBUG_LOCKDEP)
if (!debug_locks)
return;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-25 16:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 10:29 [PATCH] locking/lockdep: clean up #ifdef checks Arnd Bergmann
2019-06-28 11:03 ` Will Deacon
2019-07-01 8:23 ` Peter Zijlstra
2019-07-25 16:04 ` [tip:locking/core] locking/lockdep: Clean " tip-bot for Arnd Bergmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.