1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Runtime locking correctness validator
6 * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra
8 * see Documentation/locking/lockdep-design.rst for more details.
10 #ifndef __LINUX_LOCKDEP_H
11 #define __LINUX_LOCKDEP_H
17 extern int prove_locking;
20 #define MAX_LOCKDEP_SUBCLASSES 8UL
22 #include <linux/types.h>
24 enum lockdep_wait_type {
25 LD_WAIT_INV = 0, /* not checked, catch all */
27 LD_WAIT_FREE, /* wait free, rcu etc.. */
28 LD_WAIT_SPIN, /* spin loops, raw_spinlock_t etc.. */
30 #ifdef CONFIG_PROVE_RAW_LOCK_NESTING
31 LD_WAIT_CONFIG, /* CONFIG_PREEMPT_LOCK, spinlock_t etc.. */
33 LD_WAIT_CONFIG = LD_WAIT_SPIN,
35 LD_WAIT_SLEEP, /* sleeping locks, mutex_t etc.. */
37 LD_WAIT_MAX, /* must be last */
42 #include <linux/linkage.h>
43 #include <linux/list.h>
44 #include <linux/debug_locks.h>
45 #include <linux/stacktrace.h>
48 * We'd rather not expose kernel/lockdep_states.h this wide, but we do need
49 * the total number of states... :-(
51 #define XXX_LOCK_USAGE_STATES (1+2*4)
54 * NR_LOCKDEP_CACHING_CLASSES ... Number of classes
55 * cached in the instance of lockdep_map
57 * Currently main class (subclass == 0) and signle depth subclass
58 * are cached in lockdep_map. This optimization is mainly targeting
59 * on rq->lock. double_rq_lock() acquires this highly competitive with
62 #define NR_LOCKDEP_CACHING_CLASSES 2
65 * A lockdep key is associated with each lock object. For static locks we use
66 * the lock address itself as the key. Dynamically allocated lock objects can
67 * have a statically or dynamically allocated key. Dynamically allocated lock
68 * keys must be registered before being used and must be unregistered before
69 * the key memory is freed.
71 struct lockdep_subclass_key {
73 } __attribute__ ((__packed__));
75 /* hash_entry is used to keep track of dynamically allocated keys. */
76 struct lock_class_key {
78 struct hlist_node hash_entry;
79 struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES];
83 extern struct lock_class_key __lockdep_no_validate__;
87 #define LOCKSTAT_POINTS 4
90 * The lock-class itself. The order of the structure members matters.
91 * reinit_class() zeroes the key member and all subsequent members.
97 struct hlist_node hash_entry;
100 * Entry in all_lock_classes when in use. Entry in free_lock_classes
101 * when not in use. Instances that are being freed are on one of the
102 * zapped_classes lists.
104 struct list_head lock_entry;
107 * These fields represent a directed graph of lock dependencies,
108 * to every node we attach a list of "forward" and a list of
109 * "backward" graph nodes.
111 struct list_head locks_after, locks_before;
113 const struct lockdep_subclass_key *key;
114 unsigned int subclass;
115 unsigned int dep_gen_id;
118 * IRQ/softirq usage tracking bits:
120 unsigned long usage_mask;
121 const struct lock_trace *usage_traces[XXX_LOCK_USAGE_STATES];
124 * Generation counter, when doing certain classes of graph walking,
125 * to ensure that we check one node only once:
130 short wait_type_inner;
131 short wait_type_outer;
133 #ifdef CONFIG_LOCK_STAT
134 unsigned long contention_point[LOCKSTAT_POINTS];
135 unsigned long contending_point[LOCKSTAT_POINTS];
137 } __no_randomize_layout;
139 #ifdef CONFIG_LOCK_STAT
148 bounce_acquired_write,
149 bounce_acquired_read,
150 bounce_contended_write,
151 bounce_contended_read,
154 bounce_acquired = bounce_acquired_write,
155 bounce_contended = bounce_contended_write,
158 struct lock_class_stats {
159 unsigned long contention_point[LOCKSTAT_POINTS];
160 unsigned long contending_point[LOCKSTAT_POINTS];
161 struct lock_time read_waittime;
162 struct lock_time write_waittime;
163 struct lock_time read_holdtime;
164 struct lock_time write_holdtime;
165 unsigned long bounces[nr_bounce_types];
168 struct lock_class_stats lock_stats(struct lock_class *class);
169 void clear_lock_stats(struct lock_class *class);
173 * Map the lock object (the lock instance) to the lock-class object.
174 * This is embedded into specific lock instances:
177 struct lock_class_key *key;
178 struct lock_class *class_cache[NR_LOCKDEP_CACHING_CLASSES];
180 short wait_type_outer; /* can be taken in this context */
181 short wait_type_inner; /* presents this context */
182 #ifdef CONFIG_LOCK_STAT
188 static inline void lockdep_copy_map(struct lockdep_map *to,
189 struct lockdep_map *from)
195 * Since the class cache can be modified concurrently we could observe
196 * half pointers (64bit arch using 32bit copy insns). Therefore clear
197 * the caches and take the performance hit.
199 * XXX it doesn't work well with lockdep_set_class_and_subclass(), since
200 * that relies on cache abuse.
202 for (i = 0; i < NR_LOCKDEP_CACHING_CLASSES; i++)
203 to->class_cache[i] = NULL;
207 * Every lock has a list of other locks that were taken after it.
208 * We only grow the list, never remove from it:
211 struct list_head entry;
212 struct lock_class *class;
213 struct lock_class *links_to;
214 const struct lock_trace *trace;
218 * The parent field is used to implement breadth-first search, and the
219 * bit 0 is reused to indicate if the lock has been accessed in BFS.
221 struct lock_list *parent;
225 * struct lock_chain - lock dependency chain record
227 * @irq_context: the same as irq_context in held_lock below
228 * @depth: the number of held locks in this chain
229 * @base: the index in chain_hlocks for this chain
230 * @entry: the collided lock chains in lock_chain hash list
231 * @chain_key: the hash key of this lock_chain
234 /* see BUILD_BUG_ON()s in add_chain_cache() */
235 unsigned int irq_context : 2,
239 struct hlist_node entry;
243 #define MAX_LOCKDEP_KEYS_BITS 13
244 #define MAX_LOCKDEP_KEYS (1UL << MAX_LOCKDEP_KEYS_BITS)
245 #define INITIAL_CHAIN_KEY -1
249 * One-way hash of the dependency chain up to this point. We
250 * hash the hashes step by step as the dependency chain grows.
252 * We use it for dependency-caching and we skip detection
253 * passes and dependency-updates if there is a cache-hit, so
254 * it is absolutely critical for 100% coverage of the validator
255 * to have a unique key value for every unique dependency path
256 * that can occur in the system, to make a unique hash value
257 * as likely as possible - hence the 64-bit width.
259 * The task struct holds the current hash value (initialized
260 * with zero), here we store the previous hash value:
263 unsigned long acquire_ip;
264 struct lockdep_map *instance;
265 struct lockdep_map *nest_lock;
266 #ifdef CONFIG_LOCK_STAT
271 * class_idx is zero-indexed; it points to the element in
272 * lock_classes this held lock instance belongs to. class_idx is in
273 * the range from 0 to (MAX_LOCKDEP_KEYS-1) inclusive.
275 unsigned int class_idx:MAX_LOCKDEP_KEYS_BITS;
277 * The lock-stack is unified in that the lock chains of interrupt
278 * contexts nest ontop of process context chains, but we 'separate'
279 * the hashes by starting with 0 if we cross into an interrupt
280 * context, and we also keep do not add cross-context lock
281 * dependencies - the lock usage graph walking covers that area
282 * anyway, and we'd just unnecessarily increase the number of
283 * dependencies otherwise. [Note: hardirq and softirq contexts
284 * are separated from each other too.]
286 * The following field is used to detect when we cross into an
289 unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */
290 unsigned int trylock:1; /* 16 bits */
292 unsigned int read:2; /* see lock_acquire() comment */
293 unsigned int check:1; /* see lock_acquire() comment */
294 unsigned int hardirqs_off:1;
295 unsigned int references:12; /* 32 bits */
296 unsigned int pin_count;
300 * Initialization, self-test and debugging-output methods:
302 extern void lockdep_init(void);
303 extern void lockdep_reset(void);
304 extern void lockdep_reset_lock(struct lockdep_map *lock);
305 extern void lockdep_free_key_range(void *start, unsigned long size);
306 extern asmlinkage void lockdep_sys_exit(void);
307 extern void lockdep_set_selftest_task(struct task_struct *task);
309 extern void lockdep_init_task(struct task_struct *task);
312 * Split the recrursion counter in two to readily detect 'off' vs recursion.
314 #define LOCKDEP_RECURSION_BITS 16
315 #define LOCKDEP_OFF (1U << LOCKDEP_RECURSION_BITS)
316 #define LOCKDEP_RECURSION_MASK (LOCKDEP_OFF - 1)
319 * lockdep_{off,on}() are macros to avoid tracing and kprobes; not inlines due
320 * to header dependencies.
323 #define lockdep_off() \
325 current->lockdep_recursion += LOCKDEP_OFF; \
328 #define lockdep_on() \
330 current->lockdep_recursion -= LOCKDEP_OFF; \
333 extern void lockdep_register_key(struct lock_class_key *key);
334 extern void lockdep_unregister_key(struct lock_class_key *key);
337 * These methods are used by specific locking variants (spinlocks,
338 * rwlocks, mutexes and rwsems) to pass init/acquire/release events
342 extern void lockdep_init_map_waits(struct lockdep_map *lock, const char *name,
343 struct lock_class_key *key, int subclass, short inner, short outer);
346 lockdep_init_map_wait(struct lockdep_map *lock, const char *name,
347 struct lock_class_key *key, int subclass, short inner)
349 lockdep_init_map_waits(lock, name, key, subclass, inner, LD_WAIT_INV);
352 static inline void lockdep_init_map(struct lockdep_map *lock, const char *name,
353 struct lock_class_key *key, int subclass)
355 lockdep_init_map_wait(lock, name, key, subclass, LD_WAIT_INV);
359 * Reinitialize a lock key - for cases where there is special locking or
360 * special initialization of locks so that the validator gets the scope
361 * of dependencies wrong: they are either too broad (they need a class-split)
362 * or they are too narrow (they suffer from a false class-split):
364 #define lockdep_set_class(lock, key) \
365 lockdep_init_map_waits(&(lock)->dep_map, #key, key, 0, \
366 (lock)->dep_map.wait_type_inner, \
367 (lock)->dep_map.wait_type_outer)
369 #define lockdep_set_class_and_name(lock, key, name) \
370 lockdep_init_map_waits(&(lock)->dep_map, name, key, 0, \
371 (lock)->dep_map.wait_type_inner, \
372 (lock)->dep_map.wait_type_outer)
374 #define lockdep_set_class_and_subclass(lock, key, sub) \
375 lockdep_init_map_waits(&(lock)->dep_map, #key, key, sub,\
376 (lock)->dep_map.wait_type_inner, \
377 (lock)->dep_map.wait_type_outer)
379 #define lockdep_set_subclass(lock, sub) \
380 lockdep_init_map_waits(&(lock)->dep_map, #lock, (lock)->dep_map.key, sub,\
381 (lock)->dep_map.wait_type_inner, \
382 (lock)->dep_map.wait_type_outer)
384 #define lockdep_set_novalidate_class(lock) \
385 lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock)
388 * Compare locking classes
390 #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key)
392 static inline int lockdep_match_key(struct lockdep_map *lock,
393 struct lock_class_key *key)
395 return lock->key == key;
403 * 0: exclusive (write) acquire
404 * 1: read-acquire (no recursion allowed)
405 * 2: read-acquire with same-instance recursion allowed
409 * 0: simple checks (freeing, held-at-exit-time, etc.)
412 extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
413 int trylock, int read, int check,
414 struct lockdep_map *nest_lock, unsigned long ip);
416 extern void lock_release(struct lockdep_map *lock, unsigned long ip);
419 * Same "read" as for lock_acquire(), except -1 means any.
421 extern int lock_is_held_type(const struct lockdep_map *lock, int read);
423 static inline int lock_is_held(const struct lockdep_map *lock)
425 return lock_is_held_type(lock, -1);
428 #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map)
429 #define lockdep_is_held_type(lock, r) lock_is_held_type(&(lock)->dep_map, (r))
431 extern void lock_set_class(struct lockdep_map *lock, const char *name,
432 struct lock_class_key *key, unsigned int subclass,
435 static inline void lock_set_subclass(struct lockdep_map *lock,
436 unsigned int subclass, unsigned long ip)
438 lock_set_class(lock, lock->name, lock->key, subclass, ip);
441 extern void lock_downgrade(struct lockdep_map *lock, unsigned long ip);
443 struct pin_cookie { unsigned int val; };
445 #define NIL_COOKIE (struct pin_cookie){ .val = 0U, }
447 extern struct pin_cookie lock_pin_lock(struct lockdep_map *lock);
448 extern void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie);
449 extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie);
451 #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0)
453 #define lockdep_assert_held(l) do { \
454 WARN_ON(debug_locks && !lockdep_is_held(l)); \
457 #define lockdep_assert_held_write(l) do { \
458 WARN_ON(debug_locks && !lockdep_is_held_type(l, 0)); \
461 #define lockdep_assert_held_read(l) do { \
462 WARN_ON(debug_locks && !lockdep_is_held_type(l, 1)); \
465 #define lockdep_assert_held_once(l) do { \
466 WARN_ON_ONCE(debug_locks && !lockdep_is_held(l)); \
469 #define lockdep_recursing(tsk) ((tsk)->lockdep_recursion)
471 #define lockdep_pin_lock(l) lock_pin_lock(&(l)->dep_map)
472 #define lockdep_repin_lock(l,c) lock_repin_lock(&(l)->dep_map, (c))
473 #define lockdep_unpin_lock(l,c) lock_unpin_lock(&(l)->dep_map, (c))
475 #else /* !CONFIG_LOCKDEP */
477 static inline void lockdep_init_task(struct task_struct *task)
481 static inline void lockdep_off(void)
485 static inline void lockdep_on(void)
489 static inline void lockdep_set_selftest_task(struct task_struct *task)
493 # define lock_acquire(l, s, t, r, c, n, i) do { } while (0)
494 # define lock_release(l, i) do { } while (0)
495 # define lock_downgrade(l, i) do { } while (0)
496 # define lock_set_class(l, n, k, s, i) do { } while (0)
497 # define lock_set_subclass(l, s, i) do { } while (0)
498 # define lockdep_init() do { } while (0)
499 # define lockdep_init_map_waits(lock, name, key, sub, inner, outer) \
500 do { (void)(name); (void)(key); } while (0)
501 # define lockdep_init_map_wait(lock, name, key, sub, inner) \
502 do { (void)(name); (void)(key); } while (0)
503 # define lockdep_init_map(lock, name, key, sub) \
504 do { (void)(name); (void)(key); } while (0)
505 # define lockdep_set_class(lock, key) do { (void)(key); } while (0)
506 # define lockdep_set_class_and_name(lock, key, name) \
507 do { (void)(key); (void)(name); } while (0)
508 #define lockdep_set_class_and_subclass(lock, key, sub) \
509 do { (void)(key); } while (0)
510 #define lockdep_set_subclass(lock, sub) do { } while (0)
512 #define lockdep_set_novalidate_class(lock) do { } while (0)
515 * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP
516 * case since the result is not well defined and the caller should rather
517 * #ifdef the call himself.
520 # define lockdep_reset() do { debug_locks = 1; } while (0)
521 # define lockdep_free_key_range(start, size) do { } while (0)
522 # define lockdep_sys_exit() do { } while (0)
524 * The class key takes no space if lockdep is disabled:
526 struct lock_class_key { };
528 static inline void lockdep_register_key(struct lock_class_key *key)
532 static inline void lockdep_unregister_key(struct lock_class_key *key)
537 * The lockdep_map takes no space if lockdep is disabled:
539 struct lockdep_map { };
541 #define lockdep_depth(tsk) (0)
543 #define lockdep_is_held_type(l, r) (1)
545 #define lockdep_assert_held(l) do { (void)(l); } while (0)
546 #define lockdep_assert_held_write(l) do { (void)(l); } while (0)
547 #define lockdep_assert_held_read(l) do { (void)(l); } while (0)
548 #define lockdep_assert_held_once(l) do { (void)(l); } while (0)
550 #define lockdep_recursing(tsk) (0)
552 struct pin_cookie { };
554 #define NIL_COOKIE (struct pin_cookie){ }
556 #define lockdep_pin_lock(l) ({ struct pin_cookie cookie = { }; cookie; })
557 #define lockdep_repin_lock(l, c) do { (void)(l); (void)(c); } while (0)
558 #define lockdep_unpin_lock(l, c) do { (void)(l); (void)(c); } while (0)
560 #endif /* !LOCKDEP */
562 enum xhlock_context_t {
568 #define lockdep_init_map_crosslock(m, n, k, s) do {} while (0)
570 * To initialize a lockdep_map statically use this macro.
571 * Note that _name must not be NULL.
573 #define STATIC_LOCKDEP_MAP_INIT(_name, _key) \
574 { .name = (_name), .key = (void *)(_key), }
576 static inline void lockdep_invariant_state(bool force) {}
577 static inline void lockdep_free_task(struct task_struct *task) {}
579 #ifdef CONFIG_LOCK_STAT
581 extern void lock_contended(struct lockdep_map *lock, unsigned long ip);
582 extern void lock_acquired(struct lockdep_map *lock, unsigned long ip);
584 #define LOCK_CONTENDED(_lock, try, lock) \
587 lock_contended(&(_lock)->dep_map, _RET_IP_); \
590 lock_acquired(&(_lock)->dep_map, _RET_IP_); \
593 #define LOCK_CONTENDED_RETURN(_lock, try, lock) \
597 lock_contended(&(_lock)->dep_map, _RET_IP_); \
598 ____err = lock(_lock); \
601 lock_acquired(&(_lock)->dep_map, _RET_IP_); \
605 #else /* CONFIG_LOCK_STAT */
607 #define lock_contended(lockdep_map, ip) do {} while (0)
608 #define lock_acquired(lockdep_map, ip) do {} while (0)
610 #define LOCK_CONTENDED(_lock, try, lock) \
613 #define LOCK_CONTENDED_RETURN(_lock, try, lock) \
616 #endif /* CONFIG_LOCK_STAT */
618 #ifdef CONFIG_LOCKDEP
621 * On lockdep we dont want the hand-coded irq-enable of
622 * _raw_*_lock_flags() code, because lockdep assumes
623 * that interrupts are not re-enabled during lock-acquire:
625 #define LOCK_CONTENDED_FLAGS(_lock, try, lock, lockfl, flags) \
626 LOCK_CONTENDED((_lock), (try), (lock))
628 #else /* CONFIG_LOCKDEP */
630 #define LOCK_CONTENDED_FLAGS(_lock, try, lock, lockfl, flags) \
631 lockfl((_lock), (flags))
633 #endif /* CONFIG_LOCKDEP */
635 #ifdef CONFIG_PROVE_LOCKING
636 extern void print_irqtrace_events(struct task_struct *curr);
638 static inline void print_irqtrace_events(struct task_struct *curr)
644 * For trivial one-depth nesting of a lock-class, the following
645 * global define can be used. (Subsystems with multiple levels
646 * of nesting should define their own lock-nesting subclasses.)
648 #define SINGLE_DEPTH_NESTING 1
651 * Map the dependency ops to NOP or to real lockdep ops, depending
652 * on the per lock-class debug mode:
655 #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
656 #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 1, n, i)
657 #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 1, n, i)
659 #define spin_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
660 #define spin_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
661 #define spin_release(l, i) lock_release(l, i)
663 #define rwlock_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
664 #define rwlock_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i)
665 #define rwlock_release(l, i) lock_release(l, i)
667 #define seqcount_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
668 #define seqcount_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i)
669 #define seqcount_release(l, i) lock_release(l, i)
671 #define mutex_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
672 #define mutex_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
673 #define mutex_release(l, i) lock_release(l, i)
675 #define rwsem_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
676 #define rwsem_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
677 #define rwsem_acquire_read(l, s, t, i) lock_acquire_shared(l, s, t, NULL, i)
678 #define rwsem_release(l, i) lock_release(l, i)
680 #define lock_map_acquire(l) lock_acquire_exclusive(l, 0, 0, NULL, _THIS_IP_)
681 #define lock_map_acquire_read(l) lock_acquire_shared_recursive(l, 0, 0, NULL, _THIS_IP_)
682 #define lock_map_acquire_tryread(l) lock_acquire_shared_recursive(l, 0, 1, NULL, _THIS_IP_)
683 #define lock_map_release(l) lock_release(l, _THIS_IP_)
685 #ifdef CONFIG_PROVE_LOCKING
686 # define might_lock(lock) \
688 typecheck(struct lockdep_map *, &(lock)->dep_map); \
689 lock_acquire(&(lock)->dep_map, 0, 0, 0, 1, NULL, _THIS_IP_); \
690 lock_release(&(lock)->dep_map, _THIS_IP_); \
692 # define might_lock_read(lock) \
694 typecheck(struct lockdep_map *, &(lock)->dep_map); \
695 lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \
696 lock_release(&(lock)->dep_map, _THIS_IP_); \
698 # define might_lock_nested(lock, subclass) \
700 typecheck(struct lockdep_map *, &(lock)->dep_map); \
701 lock_acquire(&(lock)->dep_map, subclass, 0, 1, 1, NULL, \
703 lock_release(&(lock)->dep_map, _THIS_IP_); \
706 #define lockdep_assert_irqs_enabled() do { \
707 WARN_ONCE(debug_locks && !current->lockdep_recursion && \
708 !current->hardirqs_enabled, \
709 "IRQs not enabled as expected\n"); \
712 #define lockdep_assert_irqs_disabled() do { \
713 WARN_ONCE(debug_locks && !current->lockdep_recursion && \
714 current->hardirqs_enabled, \
715 "IRQs not disabled as expected\n"); \
718 #define lockdep_assert_in_irq() do { \
719 WARN_ONCE(debug_locks && !current->lockdep_recursion && \
720 !current->hardirq_context, \
721 "Not in hardirq as expected\n"); \
725 # define might_lock(lock) do { } while (0)
726 # define might_lock_read(lock) do { } while (0)
727 # define might_lock_nested(lock, subclass) do { } while (0)
728 # define lockdep_assert_irqs_enabled() do { } while (0)
729 # define lockdep_assert_irqs_disabled() do { } while (0)
730 # define lockdep_assert_in_irq() do { } while (0)
733 #ifdef CONFIG_PROVE_RAW_LOCK_NESTING
735 # define lockdep_assert_RT_in_threaded_ctx() do { \
736 WARN_ONCE(debug_locks && !current->lockdep_recursion && \
737 current->hardirq_context && \
738 !(current->hardirq_threaded || current->irq_config), \
739 "Not in threaded context on PREEMPT_RT as expected\n"); \
744 # define lockdep_assert_RT_in_threaded_ctx() do { } while (0)
748 #ifdef CONFIG_LOCKDEP
749 void lockdep_rcu_suspicious(const char *file, const int line, const char *s);
752 lockdep_rcu_suspicious(const char *file, const int line, const char *s)
757 #endif /* __LINUX_LOCKDEP_H */