Skip to content

Commit

Permalink
Merge branch 'core/locking' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/frederic/random-tracing into core/locking
  • Loading branch information
Ingo Molnar committed May 3, 2010
2 parents 53ba4f2 + 913769f commit 0e417fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 6 additions & 1 deletion kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -2298,7 +2298,12 @@ void trace_hardirqs_on_caller(unsigned long ip)
return;

if (unlikely(curr->hardirqs_enabled)) {
debug_atomic_inc(redundant_hardirqs_on);
/*
* Neither irq nor preemption are disabled here
* so this is racy by nature but loosing one hit
* in a stat is not a big deal.
*/
this_cpu_inc(lockdep_stats.redundant_hardirqs_on);
return;
}
/* we'll do an OFF -> ON transition: */
Expand Down
10 changes: 2 additions & 8 deletions kernel/lockdep_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,13 @@ struct lockdep_stats {
DECLARE_PER_CPU(struct lockdep_stats, lockdep_stats);

#define debug_atomic_inc(ptr) { \
struct lockdep_stats *__cpu_lockdep_stats; \
\
WARN_ON_ONCE(!irqs_disabled()); \
__cpu_lockdep_stats = &__get_cpu_var(lockdep_stats); \
__cpu_lockdep_stats->ptr++; \
this_cpu_inc(lockdep_stats.ptr); \
}

#define debug_atomic_dec(ptr) { \
struct lockdep_stats *__cpu_lockdep_stats; \
\
WARN_ON_ONCE(!irqs_disabled()); \
__cpu_lockdep_stats = &__get_cpu_var(lockdep_stats); \
__cpu_lockdep_stats->ptr--; \
this_cpu_inc(lockdep_stats.ptr); \
}

#define debug_atomic_read(ptr) ({ \
Expand Down

0 comments on commit 0e417fe

Please sign in to comment.