提交 ba697f40 编写于 作者: F Frederic Weisbecker

lockdep: Provide off case for redundant_hardirqs_on increment

We forgot to provide a !CONFIG_DEBUG_LOCKDEP case for the
redundant_hardirqs_on stat handling.

Manage that in the headers with a new __debug_atomic_inc() helper.

Fixes:

	kernel/lockdep.c:2306: error: 'lockdep_stats' undeclared (first use in this function)
	kernel/lockdep.c:2306: error: (Each undeclared identifier is reported only once
	kernel/lockdep.c:2306: error: for each function it appears in.)
Reported-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
上级 0e417fe1
...@@ -2303,7 +2303,7 @@ void trace_hardirqs_on_caller(unsigned long ip) ...@@ -2303,7 +2303,7 @@ void trace_hardirqs_on_caller(unsigned long ip)
* so this is racy by nature but loosing one hit * so this is racy by nature but loosing one hit
* in a stat is not a big deal. * in a stat is not a big deal.
*/ */
this_cpu_inc(lockdep_stats.redundant_hardirqs_on); __debug_atomic_inc(redundant_hardirqs_on);
return; return;
} }
/* we'll do an OFF -> ON transition: */ /* we'll do an OFF -> ON transition: */
......
...@@ -139,6 +139,9 @@ struct lockdep_stats { ...@@ -139,6 +139,9 @@ struct lockdep_stats {
DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats); DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats);
#define __debug_atomic_inc(ptr) \
this_cpu_inc(lockdep_stats.ptr);
#define debug_atomic_inc(ptr) { \ #define debug_atomic_inc(ptr) { \
WARN_ON_ONCE(!irqs_disabled()); \ WARN_ON_ONCE(!irqs_disabled()); \
this_cpu_inc(lockdep_stats.ptr); \ this_cpu_inc(lockdep_stats.ptr); \
...@@ -160,6 +163,7 @@ DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats); ...@@ -160,6 +163,7 @@ DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats);
__total; \ __total; \
}) })
#else #else
# define __debug_atomic_inc(ptr) do { } while (0)
# define debug_atomic_inc(ptr) do { } while (0) # define debug_atomic_inc(ptr) do { } while (0)
# define debug_atomic_dec(ptr) do { } while (0) # define debug_atomic_dec(ptr) do { } while (0)
# define debug_atomic_read(ptr) 0 # define debug_atomic_read(ptr) 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册