aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug49
-rw-r--r--lib/dynamic_debug.c42
-rw-r--r--lib/radix-tree.c2
3 files changed, 49 insertions, 44 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 1b4afd2e6ca0..21ac83070a80 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -482,6 +482,7 @@ config PROVE_LOCKING
482 select DEBUG_SPINLOCK 482 select DEBUG_SPINLOCK
483 select DEBUG_MUTEXES 483 select DEBUG_MUTEXES
484 select DEBUG_LOCK_ALLOC 484 select DEBUG_LOCK_ALLOC
485 select TRACE_IRQFLAGS
485 default n 486 default n
486 help 487 help
487 This feature enables the kernel to prove that all locking 488 This feature enables the kernel to prove that all locking
@@ -539,6 +540,23 @@ config PROVE_RCU_REPEATEDLY
539 disabling, allowing multiple RCU-lockdep warnings to be printed 540 disabling, allowing multiple RCU-lockdep warnings to be printed
540 on a single reboot. 541 on a single reboot.
541 542
543 Say Y to allow multiple RCU-lockdep warnings per boot.
544
545 Say N if you are unsure.
546
547config SPARSE_RCU_POINTER
548 bool "RCU debugging: sparse-based checks for pointer usage"
549 default n
550 help
551 This feature enables the __rcu sparse annotation for
552 RCU-protected pointers. This annotation will cause sparse
553 to flag any non-RCU used of annotated pointers. This can be
554 helpful when debugging RCU usage. Please note that this feature
555 is not intended to enforce code cleanliness; it is instead merely
556 a debugging aid.
557
558 Say Y to make sparse flag questionable use of RCU-protected pointers
559
542 Say N if you are unsure. 560 Say N if you are unsure.
543 561
544config LOCKDEP 562config LOCKDEP
@@ -579,11 +597,10 @@ config DEBUG_LOCKDEP
579 of more runtime overhead. 597 of more runtime overhead.
580 598
581config TRACE_IRQFLAGS 599config TRACE_IRQFLAGS
582 depends on DEBUG_KERNEL
583 bool 600 bool
584 default y 601 help
585 depends on TRACE_IRQFLAGS_SUPPORT 602 Enables hooks to interrupt enabling and disabling for
586 depends on PROVE_LOCKING 603 either tracing or lock debugging.
587 604
588config DEBUG_SPINLOCK_SLEEP 605config DEBUG_SPINLOCK_SLEEP
589 bool "Spinlock debugging: sleep-inside-spinlock checking" 606 bool "Spinlock debugging: sleep-inside-spinlock checking"
@@ -832,6 +849,30 @@ config RCU_CPU_STALL_DETECTOR
832 849
833 Say Y if you are unsure. 850 Say Y if you are unsure.
834 851
852config RCU_CPU_STALL_TIMEOUT
853 int "RCU CPU stall timeout in seconds"
854 depends on RCU_CPU_STALL_DETECTOR
855 range 3 300
856 default 60
857 help
858 If a given RCU grace period extends more than the specified
859 number of seconds, a CPU stall warning is printed. If the
860 RCU grace period persists, additional CPU stall warnings are
861 printed at more widely spaced intervals.
862
863config RCU_CPU_STALL_DETECTOR_RUNNABLE
864 bool "RCU CPU stall checking starts automatically at boot"
865 depends on RCU_CPU_STALL_DETECTOR
866 default y
867 help
868 If set, start checking for RCU CPU stalls immediately on
869 boot. Otherwise, RCU CPU stall checking must be manually
870 enabled.
871
872 Say Y if you are unsure.
873
874 Say N if you wish to suppress RCU CPU stall checking during boot.
875
835config RCU_CPU_STALL_VERBOSE 876config RCU_CPU_STALL_VERBOSE
836 bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR" 877 bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR"
837 depends on RCU_CPU_STALL_DETECTOR && TREE_PREEMPT_RCU 878 depends on RCU_CPU_STALL_DETECTOR && TREE_PREEMPT_RCU
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 02afc2533728..7bd6df781ce5 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -26,19 +26,11 @@
26#include <linux/dynamic_debug.h> 26#include <linux/dynamic_debug.h>
27#include <linux/debugfs.h> 27#include <linux/debugfs.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/jump_label.h>
29 30
30extern struct _ddebug __start___verbose[]; 31extern struct _ddebug __start___verbose[];
31extern struct _ddebug __stop___verbose[]; 32extern struct _ddebug __stop___verbose[];
32 33
33/* dynamic_debug_enabled, and dynamic_debug_enabled2 are bitmasks in which
34 * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They
35 * use independent hash functions, to reduce the chance of false positives.
36 */
37long long dynamic_debug_enabled;
38EXPORT_SYMBOL_GPL(dynamic_debug_enabled);
39long long dynamic_debug_enabled2;
40EXPORT_SYMBOL_GPL(dynamic_debug_enabled2);
41
42struct ddebug_table { 34struct ddebug_table {
43 struct list_head link; 35 struct list_head link;
44 char *mod_name; 36 char *mod_name;
@@ -88,26 +80,6 @@ static char *ddebug_describe_flags(struct _ddebug *dp, char *buf,
88} 80}
89 81
90/* 82/*
91 * must be called with ddebug_lock held
92 */
93
94static int disabled_hash(char hash, bool first_table)
95{
96 struct ddebug_table *dt;
97 char table_hash_value;
98
99 list_for_each_entry(dt, &ddebug_tables, link) {
100 if (first_table)
101 table_hash_value = dt->ddebugs->primary_hash;
102 else
103 table_hash_value = dt->ddebugs->secondary_hash;
104 if (dt->num_enabled && (hash == table_hash_value))
105 return 0;
106 }
107 return 1;
108}
109
110/*
111 * Search the tables for _ddebug's which match the given 83 * Search the tables for _ddebug's which match the given
112 * `query' and apply the `flags' and `mask' to them. Tells 84 * `query' and apply the `flags' and `mask' to them. Tells
113 * the user which ddebug's were changed, or whether none 85 * the user which ddebug's were changed, or whether none
@@ -170,17 +142,9 @@ static void ddebug_change(const struct ddebug_query *query,
170 dt->num_enabled++; 142 dt->num_enabled++;
171 dp->flags = newflags; 143 dp->flags = newflags;
172 if (newflags) { 144 if (newflags) {
173 dynamic_debug_enabled |= 145 jump_label_enable(&dp->enabled);
174 (1LL << dp->primary_hash);
175 dynamic_debug_enabled2 |=
176 (1LL << dp->secondary_hash);
177 } else { 146 } else {
178 if (disabled_hash(dp->primary_hash, true)) 147 jump_label_disable(&dp->enabled);
179 dynamic_debug_enabled &=
180 ~(1LL << dp->primary_hash);
181 if (disabled_hash(dp->secondary_hash, false))
182 dynamic_debug_enabled2 &=
183 ~(1LL << dp->secondary_hash);
184 } 148 }
185 if (verbose) 149 if (verbose)
186 printk(KERN_INFO 150 printk(KERN_INFO
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index efd16fa80b1c..6f412ab4c24f 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -49,7 +49,7 @@ struct radix_tree_node {
49 unsigned int height; /* Height from the bottom */ 49 unsigned int height; /* Height from the bottom */
50 unsigned int count; 50 unsigned int count;
51 struct rcu_head rcu_head; 51 struct rcu_head rcu_head;
52 void *slots[RADIX_TREE_MAP_SIZE]; 52 void __rcu *slots[RADIX_TREE_MAP_SIZE];
53 unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS]; 53 unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS];
54}; 54};
55 55