@@ -385,9 +385,11 @@ module_param(qlowmark, long, 0444);
385
385
386
386
static ulong jiffies_till_first_fqs = ULONG_MAX ;
387
387
static ulong jiffies_till_next_fqs = ULONG_MAX ;
388
+ static bool rcu_kick_kthreads ;
388
389
389
390
module_param (jiffies_till_first_fqs , ulong , 0644 );
390
391
module_param (jiffies_till_next_fqs , ulong , 0644 );
392
+ module_param (rcu_kick_kthreads , bool , 0644 );
391
393
392
394
/*
393
395
* How long the grace period must be before we start recruiting
@@ -1251,6 +1253,24 @@ static void rcu_dump_cpu_stacks(struct rcu_state *rsp)
1251
1253
}
1252
1254
}
1253
1255
1256
+ /*
1257
+ * If too much time has passed in the current grace period, and if
1258
+ * so configured, go kick the relevant kthreads.
1259
+ */
1260
+ static void rcu_stall_kick_kthreads (struct rcu_state * rsp )
1261
+ {
1262
+ unsigned long j ;
1263
+
1264
+ if (!rcu_kick_kthreads )
1265
+ return ;
1266
+ j = READ_ONCE (rsp -> jiffies_kick_kthreads );
1267
+ if (time_after (jiffies , j ) && rsp -> gp_kthread ) {
1268
+ WARN_ONCE (1 , "Kicking %s grace-period kthread\n" , rsp -> name );
1269
+ wake_up_process (rsp -> gp_kthread );
1270
+ WRITE_ONCE (rsp -> jiffies_kick_kthreads , j + HZ );
1271
+ }
1272
+ }
1273
+
1254
1274
static void print_other_cpu_stall (struct rcu_state * rsp , unsigned long gpnum )
1255
1275
{
1256
1276
int cpu ;
@@ -1262,6 +1282,11 @@ static void print_other_cpu_stall(struct rcu_state *rsp, unsigned long gpnum)
1262
1282
struct rcu_node * rnp = rcu_get_root (rsp );
1263
1283
long totqlen = 0 ;
1264
1284
1285
+ /* Kick and suppress, if so configured. */
1286
+ rcu_stall_kick_kthreads (rsp );
1287
+ if (rcu_cpu_stall_suppress )
1288
+ return ;
1289
+
1265
1290
/* Only let one CPU complain about others per time interval. */
1266
1291
1267
1292
raw_spin_lock_irqsave_rcu_node (rnp , flags );
@@ -1335,6 +1360,11 @@ static void print_cpu_stall(struct rcu_state *rsp)
1335
1360
struct rcu_node * rnp = rcu_get_root (rsp );
1336
1361
long totqlen = 0 ;
1337
1362
1363
+ /* Kick and suppress, if so configured. */
1364
+ rcu_stall_kick_kthreads (rsp );
1365
+ if (rcu_cpu_stall_suppress )
1366
+ return ;
1367
+
1338
1368
/*
1339
1369
* OK, time to rat on ourselves...
1340
1370
* See Documentation/RCU/stallwarn.txt for info on how to debug
@@ -1379,8 +1409,10 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
1379
1409
unsigned long js ;
1380
1410
struct rcu_node * rnp ;
1381
1411
1382
- if (rcu_cpu_stall_suppress || !rcu_gp_in_progress (rsp ))
1412
+ if ((rcu_cpu_stall_suppress && !rcu_kick_kthreads ) ||
1413
+ !rcu_gp_in_progress (rsp ))
1383
1414
return ;
1415
+ rcu_stall_kick_kthreads (rsp );
1384
1416
j = jiffies ;
1385
1417
1386
1418
/*
@@ -2119,8 +2151,11 @@ static int __noreturn rcu_gp_kthread(void *arg)
2119
2151
}
2120
2152
ret = 0 ;
2121
2153
for (;;) {
2122
- if (!ret )
2154
+ if (!ret ) {
2123
2155
rsp -> jiffies_force_qs = jiffies + j ;
2156
+ WRITE_ONCE (rsp -> jiffies_kick_kthreads ,
2157
+ jiffies + 3 * j );
2158
+ }
2124
2159
trace_rcu_grace_period (rsp -> name ,
2125
2160
READ_ONCE (rsp -> gpnum ),
2126
2161
TPS ("fqswait" ));
0 commit comments