diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-03-27 13:43:02 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-06-10 16:45:52 -0400 |
commit | 318bdcd95938ec3a530fc789da662ce159d50d46 (patch) | |
tree | 0af54d70189eff67991313ae01b6ca8d7d40968d /kernel/rcutiny_plugin.h | |
parent | fa2b3b0a50949537ac95a521b3546e9a87dc0565 (diff) |
rcu: Consolidate rcutiny_plugin.h ifdefs
This commit rearranges code in order to allow ifdefs to be consolidated
in kernel/rcutiny_plugin.h, simplifying the code.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutiny_plugin.h')
-rw-r--r-- | kernel/rcutiny_plugin.h | 86 |
1 files changed, 40 insertions, 46 deletions
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h index bac3a6ecb991..65ef1800f4fd 100644 --- a/kernel/rcutiny_plugin.h +++ b/kernel/rcutiny_plugin.h | |||
@@ -53,54 +53,10 @@ static struct rcu_ctrlblk rcu_bh_ctrlblk = { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 55 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
56 | #include <linux/kernel_stat.h> | ||
57 | |||
56 | int rcu_scheduler_active __read_mostly; | 58 | int rcu_scheduler_active __read_mostly; |
57 | EXPORT_SYMBOL_GPL(rcu_scheduler_active); | 59 | EXPORT_SYMBOL_GPL(rcu_scheduler_active); |
58 | #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
59 | |||
60 | #ifdef CONFIG_RCU_TRACE | ||
61 | |||
62 | static void check_cpu_stall(struct rcu_ctrlblk *rcp) | ||
63 | { | ||
64 | unsigned long j; | ||
65 | unsigned long js; | ||
66 | |||
67 | if (rcu_cpu_stall_suppress) | ||
68 | return; | ||
69 | rcp->ticks_this_gp++; | ||
70 | j = jiffies; | ||
71 | js = rcp->jiffies_stall; | ||
72 | if (*rcp->curtail && ULONG_CMP_GE(j, js)) { | ||
73 | pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n", | ||
74 | rcp->name, rcp->ticks_this_gp, rcu_dynticks_nesting, | ||
75 | jiffies - rcp->gp_start, rcp->qlen); | ||
76 | dump_stack(); | ||
77 | } | ||
78 | if (*rcp->curtail && ULONG_CMP_GE(j, js)) | ||
79 | rcp->jiffies_stall = jiffies + | ||
80 | 3 * rcu_jiffies_till_stall_check() + 3; | ||
81 | else if (ULONG_CMP_GE(j, js)) | ||
82 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); | ||
83 | } | ||
84 | |||
85 | #endif /* #ifdef CONFIG_RCU_TRACE */ | ||
86 | |||
87 | static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp) | ||
88 | { | ||
89 | #ifdef CONFIG_RCU_TRACE | ||
90 | rcp->ticks_this_gp = 0; | ||
91 | rcp->gp_start = jiffies; | ||
92 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); | ||
93 | #endif /* #ifdef CONFIG_RCU_TRACE */ | ||
94 | } | ||
95 | |||
96 | static void check_cpu_stalls(void) | ||
97 | { | ||
98 | RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk)); | ||
99 | RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk)); | ||
100 | } | ||
101 | |||
102 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
103 | #include <linux/kernel_stat.h> | ||
104 | 60 | ||
105 | /* | 61 | /* |
106 | * During boot, we forgive RCU lockdep issues. After this function is | 62 | * During boot, we forgive RCU lockdep issues. After this function is |
@@ -179,4 +135,42 @@ MODULE_AUTHOR("Paul E. McKenney"); | |||
179 | MODULE_DESCRIPTION("Read-Copy Update tracing for tiny implementation"); | 135 | MODULE_DESCRIPTION("Read-Copy Update tracing for tiny implementation"); |
180 | MODULE_LICENSE("GPL"); | 136 | MODULE_LICENSE("GPL"); |
181 | 137 | ||
138 | static void check_cpu_stall(struct rcu_ctrlblk *rcp) | ||
139 | { | ||
140 | unsigned long j; | ||
141 | unsigned long js; | ||
142 | |||
143 | if (rcu_cpu_stall_suppress) | ||
144 | return; | ||
145 | rcp->ticks_this_gp++; | ||
146 | j = jiffies; | ||
147 | js = rcp->jiffies_stall; | ||
148 | if (*rcp->curtail && ULONG_CMP_GE(j, js)) { | ||
149 | pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n", | ||
150 | rcp->name, rcp->ticks_this_gp, rcu_dynticks_nesting, | ||
151 | jiffies - rcp->gp_start, rcp->qlen); | ||
152 | dump_stack(); | ||
153 | } | ||
154 | if (*rcp->curtail && ULONG_CMP_GE(j, js)) | ||
155 | rcp->jiffies_stall = jiffies + | ||
156 | 3 * rcu_jiffies_till_stall_check() + 3; | ||
157 | else if (ULONG_CMP_GE(j, js)) | ||
158 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); | ||
159 | } | ||
160 | |||
182 | #endif /* #ifdef CONFIG_RCU_TRACE */ | 161 | #endif /* #ifdef CONFIG_RCU_TRACE */ |
162 | |||
163 | static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp) | ||
164 | { | ||
165 | #ifdef CONFIG_RCU_TRACE | ||
166 | rcp->ticks_this_gp = 0; | ||
167 | rcp->gp_start = jiffies; | ||
168 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); | ||
169 | #endif /* #ifdef CONFIG_RCU_TRACE */ | ||
170 | } | ||
171 | |||
172 | static void check_cpu_stalls(void) | ||
173 | { | ||
174 | RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk)); | ||
175 | RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk)); | ||
176 | } | ||