Skip to content

Commit 02f0f57

Browse files
committed
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RCU fix from Ingo Molnar: "An RCU Kconfig fix that eliminates an annoying interactive kconfig question for CONFIG_RCU_TORTURE_TEST_SLOW_INIT" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rcu: Control grace-period delays directly from value
2 parents 5198b44 + cb0f3f3 commit 02f0f57

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

kernel/rcu/tree.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,14 @@ static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp);
162162
static int kthread_prio = CONFIG_RCU_KTHREAD_PRIO;
163163
module_param(kthread_prio, int, 0644);
164164

165-
/* Delay in jiffies for grace-period initialization delays. */
166-
static int gp_init_delay = IS_ENABLED(CONFIG_RCU_TORTURE_TEST_SLOW_INIT)
167-
? CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY
168-
: 0;
165+
/* Delay in jiffies for grace-period initialization delays, debug only. */
166+
#ifdef CONFIG_RCU_TORTURE_TEST_SLOW_INIT
167+
static int gp_init_delay = CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY;
169168
module_param(gp_init_delay, int, 0644);
169+
#else /* #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_INIT */
170+
static const int gp_init_delay;
171+
#endif /* #else #ifdef CONFIG_RCU_TORTURE_TEST_SLOW_INIT */
172+
#define PER_RCU_NODE_PERIOD 10 /* Number of grace periods between delays. */
170173

171174
/*
172175
* Track the rcutorture test sequence number and the update version
@@ -1843,9 +1846,8 @@ static int rcu_gp_init(struct rcu_state *rsp)
18431846
raw_spin_unlock_irq(&rnp->lock);
18441847
cond_resched_rcu_qs();
18451848
ACCESS_ONCE(rsp->gp_activity) = jiffies;
1846-
if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_SLOW_INIT) &&
1847-
gp_init_delay > 0 &&
1848-
!(rsp->gpnum % (rcu_num_nodes * 10)))
1849+
if (gp_init_delay > 0 &&
1850+
!(rsp->gpnum % (rcu_num_nodes * PER_RCU_NODE_PERIOD)))
18491851
schedule_timeout_uninterruptible(gp_init_delay);
18501852
}
18511853

lib/Kconfig.debug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@ config RCU_TORTURE_TEST_SLOW_INIT_DELAY
12811281
int "How much to slow down RCU grace-period initialization"
12821282
range 0 5
12831283
default 3
1284+
depends on RCU_TORTURE_TEST_SLOW_INIT
12841285
help
12851286
This option specifies the number of jiffies to wait between
12861287
each rcu_node structure initialization.

0 commit comments

Comments
 (0)