Skip to content

Commit 7beba0c

Browse files
committed
rcutorture: Move to dynamic initialization of rcu_fwds
In order to add multiple call_rcu() forward-progress kthreads, it will be necessary to dynamically allocate and initialize. This commit therefore moves the initialization from compile time to instead immediately precede thread-creation time. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 6b1b832 commit 7beba0c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

kernel/rcu/rcutorture.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,11 +1686,7 @@ struct rcu_fwd {
16861686
unsigned long rcu_launder_gp_seq_start;
16871687
};
16881688

1689-
struct rcu_fwd rcu_fwds = {
1690-
.rcu_fwd_lock = __SPIN_LOCK_UNLOCKED(rcu_fwds.rcu_fwd_lock),
1691-
.rcu_fwd_cb_tail = &rcu_fwds.rcu_fwd_cb_head,
1692-
};
1693-
1689+
struct rcu_fwd rcu_fwds;
16941690
bool rcu_fwd_emergency_stop;
16951691

16961692
static void rcu_torture_fwd_cb_hist(struct rcu_fwd *rfp)
@@ -2026,6 +2022,8 @@ static int __init rcu_torture_fwd_prog_init(void)
20262022
WARN_ON(1); /* Make sure rcutorture notices conflict. */
20272023
return 0;
20282024
}
2025+
spin_lock_init(&rcu_fwds.rcu_fwd_lock);
2026+
rcu_fwds.rcu_fwd_cb_tail = &rcu_fwds.rcu_fwd_cb_head;
20292027
if (fwd_progress_holdoff <= 0)
20302028
fwd_progress_holdoff = 1;
20312029
if (fwd_progress_div <= 0)

0 commit comments

Comments
 (0)