Skip to content

Commit 6d48152

Browse files
committed
rcu: Remove RCU CPU stall warnings from Tiny RCU
Tiny RCU's job is to be tiny, so this commit removes its RCU CPU stall warning code. After this, there is no longer any need for rcu_sched_ctrlblk and rcu_bh_ctrlblk to be in tiny_plugin.h, so this commit also moves them to tiny.c. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
1 parent c23484f commit 6d48152

4 files changed

Lines changed: 19 additions & 97 deletions

File tree

‎kernel/rcu/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ config TASKS_RCU
7878
user-mode execution as quiescent states.
7979

8080
config RCU_STALL_COMMON
81-
def_bool ( TREE_RCU || PREEMPT_RCU || RCU_TRACE )
81+
def_bool ( TREE_RCU || PREEMPT_RCU )
8282
help
8383
This option enables RCU CPU stall code that is common between
8484
the TINY and TREE variants of RCU. The purpose is to allow

‎kernel/rcu/tiny.c‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,23 @@
3838

3939
#include "rcu.h"
4040

41-
/* Forward declarations for tiny_plugin.h. */
42-
struct rcu_ctrlblk;
43-
static void __call_rcu(struct rcu_head *head,
44-
rcu_callback_t func,
45-
struct rcu_ctrlblk *rcp);
41+
/* Global control variables for rcupdate callback mechanism. */
42+
struct rcu_ctrlblk {
43+
struct rcu_head *rcucblist; /* List of pending callbacks (CBs). */
44+
struct rcu_head **donetail; /* ->next pointer of last "done" CB. */
45+
struct rcu_head **curtail; /* ->next pointer of last CB. */
46+
};
47+
48+
/* Definition for rcupdate control block. */
49+
static struct rcu_ctrlblk rcu_sched_ctrlblk = {
50+
.donetail = &rcu_sched_ctrlblk.rcucblist,
51+
.curtail = &rcu_sched_ctrlblk.rcucblist,
52+
};
53+
54+
static struct rcu_ctrlblk rcu_bh_ctrlblk = {
55+
.donetail = &rcu_bh_ctrlblk.rcucblist,
56+
.curtail = &rcu_bh_ctrlblk.rcucblist,
57+
};
4658

4759
#include "tiny_plugin.h"
4860

@@ -65,7 +77,6 @@ EXPORT_SYMBOL(rcu_barrier_sched);
6577
*/
6678
static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
6779
{
68-
RCU_TRACE(reset_cpu_stall_ticks(rcp);)
6980
if (rcp->donetail != rcp->curtail) {
7081
rcp->donetail = rcp->curtail;
7182
return 1;
@@ -111,7 +122,6 @@ void rcu_bh_qs(void)
111122
*/
112123
void rcu_check_callbacks(int user)
113124
{
114-
RCU_TRACE(check_cpu_stalls();)
115125
if (user)
116126
rcu_sched_qs();
117127
else if (!in_softirq())
@@ -126,10 +136,8 @@ void rcu_check_callbacks(int user)
126136
*/
127137
static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
128138
{
129-
const char *rn = NULL;
130139
struct rcu_head *next, *list;
131140
unsigned long flags;
132-
RCU_TRACE(int cb_count = 0;)
133141

134142
/* Move the ready-to-invoke callbacks to a local list. */
135143
local_irq_save(flags);
@@ -147,18 +155,15 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
147155
local_irq_restore(flags);
148156

149157
/* Invoke the callbacks on the local list. */
150-
RCU_TRACE(rn = rcp->name;)
151158
while (list) {
152159
next = list->next;
153160
prefetch(next);
154161
debug_rcu_head_unqueue(list);
155162
local_bh_disable();
156-
__rcu_reclaim(rn, list);
163+
__rcu_reclaim("", list);
157164
local_bh_enable();
158165
list = next;
159-
RCU_TRACE(cb_count++;)
160166
}
161-
RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count);)
162167
}
163168

164169
static __latent_entropy void rcu_process_callbacks(struct softirq_action *unused)
@@ -202,7 +207,6 @@ static void __call_rcu(struct rcu_head *head,
202207
local_irq_save(flags);
203208
*rcp->curtail = head;
204209
rcp->curtail = &head->next;
205-
RCU_TRACE(rcp->qlen++;)
206210
local_irq_restore(flags);
207211

208212
if (unlikely(is_idle_task(current))) {
@@ -235,8 +239,5 @@ EXPORT_SYMBOL_GPL(call_rcu_bh);
235239
void __init rcu_init(void)
236240
{
237241
open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
238-
RCU_TRACE(reset_cpu_stall_ticks(&rcu_sched_ctrlblk);)
239-
RCU_TRACE(reset_cpu_stall_ticks(&rcu_bh_ctrlblk);)
240-
241242
rcu_early_boot_tests();
242243
}

‎kernel/rcu/tiny_plugin.h‎

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,6 @@
2222
* Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2323
*/
2424

25-
#include <linux/kthread.h>
26-
#include <linux/init.h>
27-
28-
/* Global control variables for rcupdate callback mechanism. */
29-
struct rcu_ctrlblk {
30-
struct rcu_head *rcucblist; /* List of pending callbacks (CBs). */
31-
struct rcu_head **donetail; /* ->next pointer of last "done" CB. */
32-
struct rcu_head **curtail; /* ->next pointer of last CB. */
33-
RCU_TRACE(long qlen); /* Number of pending CBs. */
34-
RCU_TRACE(unsigned long gp_start); /* Start time for stalls. */
35-
RCU_TRACE(unsigned long ticks_this_gp); /* Statistic for stalls. */
36-
RCU_TRACE(unsigned long jiffies_stall); /* Jiffies at next stall. */
37-
RCU_TRACE(const char *name); /* Name of RCU type. */
38-
};
39-
40-
/* Definition for rcupdate control block. */
41-
static struct rcu_ctrlblk rcu_sched_ctrlblk = {
42-
.donetail = &rcu_sched_ctrlblk.rcucblist,
43-
.curtail = &rcu_sched_ctrlblk.rcucblist,
44-
RCU_TRACE(.name = "rcu_sched")
45-
};
46-
47-
static struct rcu_ctrlblk rcu_bh_ctrlblk = {
48-
.donetail = &rcu_bh_ctrlblk.rcucblist,
49-
.curtail = &rcu_bh_ctrlblk.rcucblist,
50-
RCU_TRACE(.name = "rcu_bh")
51-
};
52-
5325
#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SRCU)
5426
#include <linux/kernel_stat.h>
5527

@@ -73,53 +45,3 @@ void __init rcu_scheduler_starting(void)
7345
}
7446

7547
#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SRCU) */
76-
77-
#ifdef CONFIG_RCU_TRACE
78-
79-
static void rcu_trace_sub_qlen(struct rcu_ctrlblk *rcp, int n)
80-
{
81-
unsigned long flags;
82-
83-
local_irq_save(flags);
84-
rcp->qlen -= n;
85-
local_irq_restore(flags);
86-
}
87-
88-
static void check_cpu_stall(struct rcu_ctrlblk *rcp)
89-
{
90-
unsigned long j;
91-
unsigned long js;
92-
93-
if (rcu_cpu_stall_suppress)
94-
return;
95-
rcp->ticks_this_gp++;
96-
j = jiffies;
97-
js = READ_ONCE(rcp->jiffies_stall);
98-
if (rcp->rcucblist && ULONG_CMP_GE(j, js)) {
99-
pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n",
100-
rcp->name, rcp->ticks_this_gp, DYNTICK_TASK_EXIT_IDLE,
101-
jiffies - rcp->gp_start, rcp->qlen);
102-
dump_stack();
103-
WRITE_ONCE(rcp->jiffies_stall,
104-
jiffies + 3 * rcu_jiffies_till_stall_check() + 3);
105-
} else if (ULONG_CMP_GE(j, js)) {
106-
WRITE_ONCE(rcp->jiffies_stall,
107-
jiffies + rcu_jiffies_till_stall_check());
108-
}
109-
}
110-
111-
static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
112-
{
113-
rcp->ticks_this_gp = 0;
114-
rcp->gp_start = jiffies;
115-
WRITE_ONCE(rcp->jiffies_stall,
116-
jiffies + rcu_jiffies_till_stall_check());
117-
}
118-
119-
static void check_cpu_stalls(void)
120-
{
121-
RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk);)
122-
RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk);)
123-
}
124-
125-
#endif /* #ifdef CONFIG_RCU_TRACE */

‎tools/testing/selftests/rcutorture/configs/rcu/TINY02‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ CONFIG_PREEMPT=n
66
CONFIG_HZ_PERIODIC=y
77
CONFIG_NO_HZ_IDLE=n
88
CONFIG_NO_HZ_FULL=n
9-
CONFIG_RCU_TRACE=y
109
CONFIG_PROVE_LOCKING=y
1110
#CHECK#CONFIG_PROVE_RCU=y
1211
CONFIG_DEBUG_LOCK_ALLOC=y

0 commit comments

Comments
 (0)