mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
lockdep: Always inline lockdep_{off,on}()
These functions are called {early,late} in nmi_{enter,exit} and should
not be traced or probed. They are also puny, so 'inline' them.
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Link: https://lkml.kernel.org/r/20200505134101.048523500@linutronix.de
This commit is contained in:
committed by
Thomas Gleixner
parent
69ea03b56e
commit
e616cb8daa
@@ -308,8 +308,27 @@ extern void lockdep_set_selftest_task(struct task_struct *task);
|
||||
|
||||
extern void lockdep_init_task(struct task_struct *task);
|
||||
|
||||
extern void lockdep_off(void);
|
||||
extern void lockdep_on(void);
|
||||
/*
|
||||
* Split the recrursion counter in two to readily detect 'off' vs recursion.
|
||||
*/
|
||||
#define LOCKDEP_RECURSION_BITS 16
|
||||
#define LOCKDEP_OFF (1U << LOCKDEP_RECURSION_BITS)
|
||||
#define LOCKDEP_RECURSION_MASK (LOCKDEP_OFF - 1)
|
||||
|
||||
/*
|
||||
* lockdep_{off,on}() are macros to avoid tracing and kprobes; not inlines due
|
||||
* to header dependencies.
|
||||
*/
|
||||
|
||||
#define lockdep_off() \
|
||||
do { \
|
||||
current->lockdep_recursion += LOCKDEP_OFF; \
|
||||
} while (0)
|
||||
|
||||
#define lockdep_on() \
|
||||
do { \
|
||||
current->lockdep_recursion -= LOCKDEP_OFF; \
|
||||
} while (0)
|
||||
|
||||
extern void lockdep_register_key(struct lock_class_key *key);
|
||||
extern void lockdep_unregister_key(struct lock_class_key *key);
|
||||
|
||||
Reference in New Issue
Block a user