diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-06-18 18:50:02 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-07-22 18:27:32 -0400 |
commit | f78f5b90c4ffa559e400c3919a02236101f29f3f (patch) | |
tree | ded8a53b5c2bc06ab532d4b9a2e6e99a12912574 | |
parent | 46f00d18fca42cc954c2e9e99a48b6f3a7741ed7 (diff) |
rcu: Rename rcu_lockdep_assert() to RCU_LOCKDEP_WARN()
This commit renames rcu_lockdep_assert() to RCU_LOCKDEP_WARN() for
consistency with the WARN() series of macros. This also requires
inverting the sense of the conditional, which this commit also does.
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | Documentation/RCU/whatisRCU.txt | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 2 | ||||
-rw-r--r-- | drivers/base/power/opp.c | 4 | ||||
-rw-r--r-- | include/linux/fdtable.h | 4 | ||||
-rw-r--r-- | include/linux/rcupdate.h | 63 | ||||
-rw-r--r-- | kernel/cgroup.c | 4 | ||||
-rw-r--r-- | kernel/pid.c | 5 | ||||
-rw-r--r-- | kernel/rcu/srcu.c | 10 | ||||
-rw-r--r-- | kernel/rcu/tiny.c | 8 | ||||
-rw-r--r-- | kernel/rcu/tree.c | 28 | ||||
-rw-r--r-- | kernel/rcu/tree_plugin.h | 8 | ||||
-rw-r--r-- | kernel/rcu/update.c | 4 | ||||
-rw-r--r-- | kernel/sched/core.c | 8 | ||||
-rw-r--r-- | kernel/workqueue.c | 20 | ||||
-rw-r--r-- | security/device_cgroup.c | 6 |
16 files changed, 101 insertions, 81 deletions
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index 5746b0c77f3e..adc2184009c5 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -883,7 +883,7 @@ All: lockdep-checked RCU-protected pointer access | |||
883 | 883 | ||
884 | rcu_access_pointer | 884 | rcu_access_pointer |
885 | rcu_dereference_raw | 885 | rcu_dereference_raw |
886 | rcu_lockdep_assert | 886 | RCU_LOCKDEP_WARN |
887 | rcu_sleep_check | 887 | rcu_sleep_check |
888 | RCU_NONIDLE | 888 | RCU_NONIDLE |
889 | 889 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index df919ff103c3..3d6b5269fb2e 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -54,9 +54,9 @@ static DEFINE_MUTEX(mce_chrdev_read_mutex); | |||
54 | 54 | ||
55 | #define rcu_dereference_check_mce(p) \ | 55 | #define rcu_dereference_check_mce(p) \ |
56 | ({ \ | 56 | ({ \ |
57 | rcu_lockdep_assert(rcu_read_lock_sched_held() || \ | 57 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \ |
58 | lockdep_is_held(&mce_chrdev_read_mutex), \ | 58 | !lockdep_is_held(&mce_chrdev_read_mutex), \ |
59 | "suspicious rcu_dereference_check_mce() usage"); \ | 59 | "suspicious rcu_dereference_check_mce() usage"); \ |
60 | smp_load_acquire(&(p)); \ | 60 | smp_load_acquire(&(p)); \ |
61 | }) | 61 | }) |
62 | 62 | ||
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index f5791927aa64..c5a5231d1d11 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -136,7 +136,7 @@ enum ctx_state ist_enter(struct pt_regs *regs) | |||
136 | preempt_count_add(HARDIRQ_OFFSET); | 136 | preempt_count_add(HARDIRQ_OFFSET); |
137 | 137 | ||
138 | /* This code is a bit fragile. Test it. */ | 138 | /* This code is a bit fragile. Test it. */ |
139 | rcu_lockdep_assert(rcu_is_watching(), "ist_enter didn't work"); | 139 | RCU_LOCKDEP_WARN(!rcu_is_watching(), "ist_enter didn't work"); |
140 | 140 | ||
141 | return prev_state; | 141 | return prev_state; |
142 | } | 142 | } |
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 677fb2843553..3b188f20b43f 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c | |||
@@ -110,8 +110,8 @@ static DEFINE_MUTEX(dev_opp_list_lock); | |||
110 | 110 | ||
111 | #define opp_rcu_lockdep_assert() \ | 111 | #define opp_rcu_lockdep_assert() \ |
112 | do { \ | 112 | do { \ |
113 | rcu_lockdep_assert(rcu_read_lock_held() || \ | 113 | RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \ |
114 | lockdep_is_held(&dev_opp_list_lock), \ | 114 | !lockdep_is_held(&dev_opp_list_lock), \ |
115 | "Missing rcu_read_lock() or " \ | 115 | "Missing rcu_read_lock() or " \ |
116 | "dev_opp_list_lock protection"); \ | 116 | "dev_opp_list_lock protection"); \ |
117 | } while (0) | 117 | } while (0) |
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index fbb88740634a..674e3e226465 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
@@ -86,8 +86,8 @@ static inline struct file *__fcheck_files(struct files_struct *files, unsigned i | |||
86 | 86 | ||
87 | static inline struct file *fcheck_files(struct files_struct *files, unsigned int fd) | 87 | static inline struct file *fcheck_files(struct files_struct *files, unsigned int fd) |
88 | { | 88 | { |
89 | rcu_lockdep_assert(rcu_read_lock_held() || | 89 | RCU_LOCKDEP_WARN(!rcu_read_lock_held() && |
90 | lockdep_is_held(&files->file_lock), | 90 | !lockdep_is_held(&files->file_lock), |
91 | "suspicious rcu_dereference_check() usage"); | 91 | "suspicious rcu_dereference_check() usage"); |
92 | return __fcheck_files(files, fd); | 92 | return __fcheck_files(files, fd); |
93 | } | 93 | } |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 33ec16b9c2ee..ff476515f716 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -536,6 +536,11 @@ static inline int rcu_read_lock_sched_held(void) | |||
536 | 536 | ||
537 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 537 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
538 | 538 | ||
539 | /* Deprecate rcu_lockdep_assert(): Use RCU_LOCKDEP_WARN() instead. */ | ||
540 | static inline void __attribute((deprecated)) deprecate_rcu_lockdep_assert(void) | ||
541 | { | ||
542 | } | ||
543 | |||
539 | #ifdef CONFIG_PROVE_RCU | 544 | #ifdef CONFIG_PROVE_RCU |
540 | 545 | ||
541 | /** | 546 | /** |
@@ -546,17 +551,32 @@ static inline int rcu_read_lock_sched_held(void) | |||
546 | #define rcu_lockdep_assert(c, s) \ | 551 | #define rcu_lockdep_assert(c, s) \ |
547 | do { \ | 552 | do { \ |
548 | static bool __section(.data.unlikely) __warned; \ | 553 | static bool __section(.data.unlikely) __warned; \ |
554 | deprecate_rcu_lockdep_assert(); \ | ||
549 | if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ | 555 | if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ |
550 | __warned = true; \ | 556 | __warned = true; \ |
551 | lockdep_rcu_suspicious(__FILE__, __LINE__, s); \ | 557 | lockdep_rcu_suspicious(__FILE__, __LINE__, s); \ |
552 | } \ | 558 | } \ |
553 | } while (0) | 559 | } while (0) |
554 | 560 | ||
561 | /** | ||
562 | * RCU_LOCKDEP_WARN - emit lockdep splat if specified condition is met | ||
563 | * @c: condition to check | ||
564 | * @s: informative message | ||
565 | */ | ||
566 | #define RCU_LOCKDEP_WARN(c, s) \ | ||
567 | do { \ | ||
568 | static bool __section(.data.unlikely) __warned; \ | ||
569 | if (debug_lockdep_rcu_enabled() && !__warned && (c)) { \ | ||
570 | __warned = true; \ | ||
571 | lockdep_rcu_suspicious(__FILE__, __LINE__, s); \ | ||
572 | } \ | ||
573 | } while (0) | ||
574 | |||
555 | #if defined(CONFIG_PROVE_RCU) && !defined(CONFIG_PREEMPT_RCU) | 575 | #if defined(CONFIG_PROVE_RCU) && !defined(CONFIG_PREEMPT_RCU) |
556 | static inline void rcu_preempt_sleep_check(void) | 576 | static inline void rcu_preempt_sleep_check(void) |
557 | { | 577 | { |
558 | rcu_lockdep_assert(!lock_is_held(&rcu_lock_map), | 578 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_lock_map), |
559 | "Illegal context switch in RCU read-side critical section"); | 579 | "Illegal context switch in RCU read-side critical section"); |
560 | } | 580 | } |
561 | #else /* #ifdef CONFIG_PROVE_RCU */ | 581 | #else /* #ifdef CONFIG_PROVE_RCU */ |
562 | static inline void rcu_preempt_sleep_check(void) | 582 | static inline void rcu_preempt_sleep_check(void) |
@@ -567,15 +587,16 @@ static inline void rcu_preempt_sleep_check(void) | |||
567 | #define rcu_sleep_check() \ | 587 | #define rcu_sleep_check() \ |
568 | do { \ | 588 | do { \ |
569 | rcu_preempt_sleep_check(); \ | 589 | rcu_preempt_sleep_check(); \ |
570 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \ | 590 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), \ |
571 | "Illegal context switch in RCU-bh read-side critical section"); \ | 591 | "Illegal context switch in RCU-bh read-side critical section"); \ |
572 | rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \ | 592 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_sched_lock_map), \ |
573 | "Illegal context switch in RCU-sched read-side critical section"); \ | 593 | "Illegal context switch in RCU-sched read-side critical section"); \ |
574 | } while (0) | 594 | } while (0) |
575 | 595 | ||
576 | #else /* #ifdef CONFIG_PROVE_RCU */ | 596 | #else /* #ifdef CONFIG_PROVE_RCU */ |
577 | 597 | ||
578 | #define rcu_lockdep_assert(c, s) do { } while (0) | 598 | #define rcu_lockdep_assert(c, s) deprecate_rcu_lockdep_assert() |
599 | #define RCU_LOCKDEP_WARN(c, s) do { } while (0) | ||
579 | #define rcu_sleep_check() do { } while (0) | 600 | #define rcu_sleep_check() do { } while (0) |
580 | 601 | ||
581 | #endif /* #else #ifdef CONFIG_PROVE_RCU */ | 602 | #endif /* #else #ifdef CONFIG_PROVE_RCU */ |
@@ -606,13 +627,13 @@ static inline void rcu_preempt_sleep_check(void) | |||
606 | ({ \ | 627 | ({ \ |
607 | /* Dependency order vs. p above. */ \ | 628 | /* Dependency order vs. p above. */ \ |
608 | typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \ | 629 | typeof(*p) *________p1 = (typeof(*p) *__force)lockless_dereference(p); \ |
609 | rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ | 630 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \ |
610 | rcu_dereference_sparse(p, space); \ | 631 | rcu_dereference_sparse(p, space); \ |
611 | ((typeof(*p) __force __kernel *)(________p1)); \ | 632 | ((typeof(*p) __force __kernel *)(________p1)); \ |
612 | }) | 633 | }) |
613 | #define __rcu_dereference_protected(p, c, space) \ | 634 | #define __rcu_dereference_protected(p, c, space) \ |
614 | ({ \ | 635 | ({ \ |
615 | rcu_lockdep_assert(c, "suspicious rcu_dereference_protected() usage"); \ | 636 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \ |
616 | rcu_dereference_sparse(p, space); \ | 637 | rcu_dereference_sparse(p, space); \ |
617 | ((typeof(*p) __force __kernel *)(p)); \ | 638 | ((typeof(*p) __force __kernel *)(p)); \ |
618 | }) | 639 | }) |
@@ -836,8 +857,8 @@ static inline void rcu_read_lock(void) | |||
836 | __rcu_read_lock(); | 857 | __rcu_read_lock(); |
837 | __acquire(RCU); | 858 | __acquire(RCU); |
838 | rcu_lock_acquire(&rcu_lock_map); | 859 | rcu_lock_acquire(&rcu_lock_map); |
839 | rcu_lockdep_assert(rcu_is_watching(), | 860 | RCU_LOCKDEP_WARN(!rcu_is_watching(), |
840 | "rcu_read_lock() used illegally while idle"); | 861 | "rcu_read_lock() used illegally while idle"); |
841 | } | 862 | } |
842 | 863 | ||
843 | /* | 864 | /* |
@@ -887,8 +908,8 @@ static inline void rcu_read_lock(void) | |||
887 | */ | 908 | */ |
888 | static inline void rcu_read_unlock(void) | 909 | static inline void rcu_read_unlock(void) |
889 | { | 910 | { |
890 | rcu_lockdep_assert(rcu_is_watching(), | 911 | RCU_LOCKDEP_WARN(!rcu_is_watching(), |
891 | "rcu_read_unlock() used illegally while idle"); | 912 | "rcu_read_unlock() used illegally while idle"); |
892 | __release(RCU); | 913 | __release(RCU); |
893 | __rcu_read_unlock(); | 914 | __rcu_read_unlock(); |
894 | rcu_lock_release(&rcu_lock_map); /* Keep acq info for rls diags. */ | 915 | rcu_lock_release(&rcu_lock_map); /* Keep acq info for rls diags. */ |
@@ -916,8 +937,8 @@ static inline void rcu_read_lock_bh(void) | |||
916 | local_bh_disable(); | 937 | local_bh_disable(); |
917 | __acquire(RCU_BH); | 938 | __acquire(RCU_BH); |
918 | rcu_lock_acquire(&rcu_bh_lock_map); | 939 | rcu_lock_acquire(&rcu_bh_lock_map); |
919 | rcu_lockdep_assert(rcu_is_watching(), | 940 | RCU_LOCKDEP_WARN(!rcu_is_watching(), |
920 | "rcu_read_lock_bh() used illegally while idle"); | 941 | "rcu_read_lock_bh() used illegally while idle"); |
921 | } | 942 | } |
922 | 943 | ||
923 | /* | 944 | /* |
@@ -927,8 +948,8 @@ static inline void rcu_read_lock_bh(void) | |||
927 | */ | 948 | */ |
928 | static inline void rcu_read_unlock_bh(void) | 949 | static inline void rcu_read_unlock_bh(void) |
929 | { | 950 | { |
930 | rcu_lockdep_assert(rcu_is_watching(), | 951 | RCU_LOCKDEP_WARN(!rcu_is_watching(), |
931 | "rcu_read_unlock_bh() used illegally while idle"); | 952 | "rcu_read_unlock_bh() used illegally while idle"); |
932 | rcu_lock_release(&rcu_bh_lock_map); | 953 | rcu_lock_release(&rcu_bh_lock_map); |
933 | __release(RCU_BH); | 954 | __release(RCU_BH); |
934 | local_bh_enable(); | 955 | local_bh_enable(); |
@@ -952,8 +973,8 @@ static inline void rcu_read_lock_sched(void) | |||
952 | preempt_disable(); | 973 | preempt_disable(); |
953 | __acquire(RCU_SCHED); | 974 | __acquire(RCU_SCHED); |
954 | rcu_lock_acquire(&rcu_sched_lock_map); | 975 | rcu_lock_acquire(&rcu_sched_lock_map); |
955 | rcu_lockdep_assert(rcu_is_watching(), | 976 | RCU_LOCKDEP_WARN(!rcu_is_watching(), |
956 | "rcu_read_lock_sched() used illegally while idle"); | 977 | "rcu_read_lock_sched() used illegally while idle"); |
957 | } | 978 | } |
958 | 979 | ||
959 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ | 980 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ |
@@ -970,8 +991,8 @@ static inline notrace void rcu_read_lock_sched_notrace(void) | |||
970 | */ | 991 | */ |
971 | static inline void rcu_read_unlock_sched(void) | 992 | static inline void rcu_read_unlock_sched(void) |
972 | { | 993 | { |
973 | rcu_lockdep_assert(rcu_is_watching(), | 994 | RCU_LOCKDEP_WARN(!rcu_is_watching(), |
974 | "rcu_read_unlock_sched() used illegally while idle"); | 995 | "rcu_read_unlock_sched() used illegally while idle"); |
975 | rcu_lock_release(&rcu_sched_lock_map); | 996 | rcu_lock_release(&rcu_sched_lock_map); |
976 | __release(RCU_SCHED); | 997 | __release(RCU_SCHED); |
977 | preempt_enable(); | 998 | preempt_enable(); |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index f89d9292eee6..b89f3168411b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -107,8 +107,8 @@ static DEFINE_SPINLOCK(release_agent_path_lock); | |||
107 | struct percpu_rw_semaphore cgroup_threadgroup_rwsem; | 107 | struct percpu_rw_semaphore cgroup_threadgroup_rwsem; |
108 | 108 | ||
109 | #define cgroup_assert_mutex_or_rcu_locked() \ | 109 | #define cgroup_assert_mutex_or_rcu_locked() \ |
110 | rcu_lockdep_assert(rcu_read_lock_held() || \ | 110 | RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \ |
111 | lockdep_is_held(&cgroup_mutex), \ | 111 | !lockdep_is_held(&cgroup_mutex), \ |
112 | "cgroup_mutex or RCU read lock required"); | 112 | "cgroup_mutex or RCU read lock required"); |
113 | 113 | ||
114 | /* | 114 | /* |
diff --git a/kernel/pid.c b/kernel/pid.c index 4fd07d5b7baf..ca368793808e 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -451,9 +451,8 @@ EXPORT_SYMBOL(pid_task); | |||
451 | */ | 451 | */ |
452 | struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns) | 452 | struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns) |
453 | { | 453 | { |
454 | rcu_lockdep_assert(rcu_read_lock_held(), | 454 | RCU_LOCKDEP_WARN(!rcu_read_lock_held(), |
455 | "find_task_by_pid_ns() needs rcu_read_lock()" | 455 | "find_task_by_pid_ns() needs rcu_read_lock() protection"); |
456 | " protection"); | ||
457 | return pid_task(find_pid_ns(nr, ns), PIDTYPE_PID); | 456 | return pid_task(find_pid_ns(nr, ns), PIDTYPE_PID); |
458 | } | 457 | } |
459 | 458 | ||
diff --git a/kernel/rcu/srcu.c b/kernel/rcu/srcu.c index de35087c92a5..d3fcb2ec8536 100644 --- a/kernel/rcu/srcu.c +++ b/kernel/rcu/srcu.c | |||
@@ -415,11 +415,11 @@ static void __synchronize_srcu(struct srcu_struct *sp, int trycount) | |||
415 | struct rcu_head *head = &rcu.head; | 415 | struct rcu_head *head = &rcu.head; |
416 | bool done = false; | 416 | bool done = false; |
417 | 417 | ||
418 | rcu_lockdep_assert(!lock_is_held(&sp->dep_map) && | 418 | RCU_LOCKDEP_WARN(lock_is_held(&sp->dep_map) || |
419 | !lock_is_held(&rcu_bh_lock_map) && | 419 | lock_is_held(&rcu_bh_lock_map) || |
420 | !lock_is_held(&rcu_lock_map) && | 420 | lock_is_held(&rcu_lock_map) || |
421 | !lock_is_held(&rcu_sched_lock_map), | 421 | lock_is_held(&rcu_sched_lock_map), |
422 | "Illegal synchronize_srcu() in same-type SRCU (or RCU) read-side critical section"); | 422 | "Illegal synchronize_srcu() in same-type SRCU (or in RCU) read-side critical section"); |
423 | 423 | ||
424 | might_sleep(); | 424 | might_sleep(); |
425 | init_completion(&rcu.completion); | 425 | init_completion(&rcu.completion); |
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index c291bd65d2cb..d0471056d0af 100644 --- a/kernel/rcu/tiny.c +++ b/kernel/rcu/tiny.c | |||
@@ -191,10 +191,10 @@ static void rcu_process_callbacks(struct softirq_action *unused) | |||
191 | */ | 191 | */ |
192 | void synchronize_sched(void) | 192 | void synchronize_sched(void) |
193 | { | 193 | { |
194 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map) && | 194 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) || |
195 | !lock_is_held(&rcu_lock_map) && | 195 | lock_is_held(&rcu_lock_map) || |
196 | !lock_is_held(&rcu_sched_lock_map), | 196 | lock_is_held(&rcu_sched_lock_map), |
197 | "Illegal synchronize_sched() in RCU read-side critical section"); | 197 | "Illegal synchronize_sched() in RCU read-side critical section"); |
198 | cond_resched(); | 198 | cond_resched(); |
199 | } | 199 | } |
200 | EXPORT_SYMBOL_GPL(synchronize_sched); | 200 | EXPORT_SYMBOL_GPL(synchronize_sched); |
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index cb64d7e13d24..0a73d26357a2 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -649,12 +649,12 @@ static void rcu_eqs_enter_common(long long oldval, bool user) | |||
649 | * It is illegal to enter an extended quiescent state while | 649 | * It is illegal to enter an extended quiescent state while |
650 | * in an RCU read-side critical section. | 650 | * in an RCU read-side critical section. |
651 | */ | 651 | */ |
652 | rcu_lockdep_assert(!lock_is_held(&rcu_lock_map), | 652 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_lock_map), |
653 | "Illegal idle entry in RCU read-side critical section."); | 653 | "Illegal idle entry in RCU read-side critical section."); |
654 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), | 654 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), |
655 | "Illegal idle entry in RCU-bh read-side critical section."); | 655 | "Illegal idle entry in RCU-bh read-side critical section."); |
656 | rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), | 656 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_sched_lock_map), |
657 | "Illegal idle entry in RCU-sched read-side critical section."); | 657 | "Illegal idle entry in RCU-sched read-side critical section."); |
658 | } | 658 | } |
659 | 659 | ||
660 | /* | 660 | /* |
@@ -3161,10 +3161,10 @@ static inline int rcu_blocking_is_gp(void) | |||
3161 | */ | 3161 | */ |
3162 | void synchronize_sched(void) | 3162 | void synchronize_sched(void) |
3163 | { | 3163 | { |
3164 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map) && | 3164 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) || |
3165 | !lock_is_held(&rcu_lock_map) && | 3165 | lock_is_held(&rcu_lock_map) || |
3166 | !lock_is_held(&rcu_sched_lock_map), | 3166 | lock_is_held(&rcu_sched_lock_map), |
3167 | "Illegal synchronize_sched() in RCU-sched read-side critical section"); | 3167 | "Illegal synchronize_sched() in RCU-sched read-side critical section"); |
3168 | if (rcu_blocking_is_gp()) | 3168 | if (rcu_blocking_is_gp()) |
3169 | return; | 3169 | return; |
3170 | if (rcu_gp_is_expedited()) | 3170 | if (rcu_gp_is_expedited()) |
@@ -3188,10 +3188,10 @@ EXPORT_SYMBOL_GPL(synchronize_sched); | |||
3188 | */ | 3188 | */ |
3189 | void synchronize_rcu_bh(void) | 3189 | void synchronize_rcu_bh(void) |
3190 | { | 3190 | { |
3191 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map) && | 3191 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) || |
3192 | !lock_is_held(&rcu_lock_map) && | 3192 | lock_is_held(&rcu_lock_map) || |
3193 | !lock_is_held(&rcu_sched_lock_map), | 3193 | lock_is_held(&rcu_sched_lock_map), |
3194 | "Illegal synchronize_rcu_bh() in RCU-bh read-side critical section"); | 3194 | "Illegal synchronize_rcu_bh() in RCU-bh read-side critical section"); |
3195 | if (rcu_blocking_is_gp()) | 3195 | if (rcu_blocking_is_gp()) |
3196 | return; | 3196 | return; |
3197 | if (rcu_gp_is_expedited()) | 3197 | if (rcu_gp_is_expedited()) |
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index a983bc68a146..9e922f111d63 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -538,10 +538,10 @@ EXPORT_SYMBOL_GPL(call_rcu); | |||
538 | */ | 538 | */ |
539 | void synchronize_rcu(void) | 539 | void synchronize_rcu(void) |
540 | { | 540 | { |
541 | rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map) && | 541 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) || |
542 | !lock_is_held(&rcu_lock_map) && | 542 | lock_is_held(&rcu_lock_map) || |
543 | !lock_is_held(&rcu_sched_lock_map), | 543 | lock_is_held(&rcu_sched_lock_map), |
544 | "Illegal synchronize_rcu() in RCU read-side critical section"); | 544 | "Illegal synchronize_rcu() in RCU read-side critical section"); |
545 | if (!rcu_scheduler_active) | 545 | if (!rcu_scheduler_active) |
546 | return; | 546 | return; |
547 | if (rcu_gp_is_expedited()) | 547 | if (rcu_gp_is_expedited()) |
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index a0a0dd03c73a..47268fb1d27b 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c | |||
@@ -589,8 +589,8 @@ EXPORT_SYMBOL_GPL(call_rcu_tasks); | |||
589 | void synchronize_rcu_tasks(void) | 589 | void synchronize_rcu_tasks(void) |
590 | { | 590 | { |
591 | /* Complain if the scheduler has not started. */ | 591 | /* Complain if the scheduler has not started. */ |
592 | rcu_lockdep_assert(!rcu_scheduler_active, | 592 | RCU_LOCKDEP_WARN(rcu_scheduler_active, |
593 | "synchronize_rcu_tasks called too soon"); | 593 | "synchronize_rcu_tasks called too soon"); |
594 | 594 | ||
595 | /* Wait for the grace period. */ | 595 | /* Wait for the grace period. */ |
596 | wait_rcu_gp(call_rcu_tasks); | 596 | wait_rcu_gp(call_rcu_tasks); |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 78b4bad10081..5e73c79fadd0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -2200,8 +2200,8 @@ unsigned long to_ratio(u64 period, u64 runtime) | |||
2200 | #ifdef CONFIG_SMP | 2200 | #ifdef CONFIG_SMP |
2201 | inline struct dl_bw *dl_bw_of(int i) | 2201 | inline struct dl_bw *dl_bw_of(int i) |
2202 | { | 2202 | { |
2203 | rcu_lockdep_assert(rcu_read_lock_sched_held(), | 2203 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held(), |
2204 | "sched RCU must be held"); | 2204 | "sched RCU must be held"); |
2205 | return &cpu_rq(i)->rd->dl_bw; | 2205 | return &cpu_rq(i)->rd->dl_bw; |
2206 | } | 2206 | } |
2207 | 2207 | ||
@@ -2210,8 +2210,8 @@ static inline int dl_bw_cpus(int i) | |||
2210 | struct root_domain *rd = cpu_rq(i)->rd; | 2210 | struct root_domain *rd = cpu_rq(i)->rd; |
2211 | int cpus = 0; | 2211 | int cpus = 0; |
2212 | 2212 | ||
2213 | rcu_lockdep_assert(rcu_read_lock_sched_held(), | 2213 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held(), |
2214 | "sched RCU must be held"); | 2214 | "sched RCU must be held"); |
2215 | for_each_cpu_and(i, rd->span, cpu_active_mask) | 2215 | for_each_cpu_and(i, rd->span, cpu_active_mask) |
2216 | cpus++; | 2216 | cpus++; |
2217 | 2217 | ||
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4c4f06176f74..cb91c63b4f4a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -338,20 +338,20 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); | |||
338 | #include <trace/events/workqueue.h> | 338 | #include <trace/events/workqueue.h> |
339 | 339 | ||
340 | #define assert_rcu_or_pool_mutex() \ | 340 | #define assert_rcu_or_pool_mutex() \ |
341 | rcu_lockdep_assert(rcu_read_lock_sched_held() || \ | 341 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \ |
342 | lockdep_is_held(&wq_pool_mutex), \ | 342 | !lockdep_is_held(&wq_pool_mutex), \ |
343 | "sched RCU or wq_pool_mutex should be held") | 343 | "sched RCU or wq_pool_mutex should be held") |
344 | 344 | ||
345 | #define assert_rcu_or_wq_mutex(wq) \ | 345 | #define assert_rcu_or_wq_mutex(wq) \ |
346 | rcu_lockdep_assert(rcu_read_lock_sched_held() || \ | 346 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \ |
347 | lockdep_is_held(&wq->mutex), \ | 347 | !lockdep_is_held(&wq->mutex), \ |
348 | "sched RCU or wq->mutex should be held") | 348 | "sched RCU or wq->mutex should be held") |
349 | 349 | ||
350 | #define assert_rcu_or_wq_mutex_or_pool_mutex(wq) \ | 350 | #define assert_rcu_or_wq_mutex_or_pool_mutex(wq) \ |
351 | rcu_lockdep_assert(rcu_read_lock_sched_held() || \ | 351 | RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \ |
352 | lockdep_is_held(&wq->mutex) || \ | 352 | !lockdep_is_held(&wq->mutex) && \ |
353 | lockdep_is_held(&wq_pool_mutex), \ | 353 | !lockdep_is_held(&wq_pool_mutex), \ |
354 | "sched RCU, wq->mutex or wq_pool_mutex should be held") | 354 | "sched RCU, wq->mutex or wq_pool_mutex should be held") |
355 | 355 | ||
356 | #define for_each_cpu_worker_pool(pool, cpu) \ | 356 | #define for_each_cpu_worker_pool(pool, cpu) \ |
357 | for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ | 357 | for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 188c1d26393b..73455089feef 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -400,9 +400,9 @@ static bool verify_new_ex(struct dev_cgroup *dev_cgroup, | |||
400 | { | 400 | { |
401 | bool match = false; | 401 | bool match = false; |
402 | 402 | ||
403 | rcu_lockdep_assert(rcu_read_lock_held() || | 403 | RCU_LOCKDEP_WARN(!rcu_read_lock_held() && |
404 | lockdep_is_held(&devcgroup_mutex), | 404 | lockdep_is_held(&devcgroup_mutex), |
405 | "device_cgroup:verify_new_ex called without proper synchronization"); | 405 | "device_cgroup:verify_new_ex called without proper synchronization"); |
406 | 406 | ||
407 | if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) { | 407 | if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) { |
408 | if (behavior == DEVCG_DEFAULT_ALLOW) { | 408 | if (behavior == DEVCG_DEFAULT_ALLOW) { |