Skip to content

Commit 81f00c4

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
refscale: Exercise DEFINE_STATIC_SRCU_FAST() and init_srcu_struct_fast()
This commit updates the initialization for the "srcu-fast" scale type to use DEFINE_STATIC_SRCU_FAST() when reader_flavor is equal to SRCU_READ_FLAVOR_FAST. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: <bpf@vger.kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
1 parent 609460a commit 81f00c4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

kernel/rcu/refscale.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ static const struct ref_scale_ops rcu_ops = {
184184

185185
// Definitions for SRCU ref scale testing.
186186
DEFINE_STATIC_SRCU(srcu_refctl_scale);
187+
DEFINE_STATIC_SRCU_FAST(srcu_fast_refctl_scale);
187188
static struct srcu_struct *srcu_ctlp = &srcu_refctl_scale;
188189

189190
static void srcu_ref_scale_read_section(const int nloops)
@@ -216,6 +217,12 @@ static const struct ref_scale_ops srcu_ops = {
216217
.name = "srcu"
217218
};
218219

220+
static bool srcu_fast_sync_scale_init(void)
221+
{
222+
srcu_ctlp = &srcu_fast_refctl_scale;
223+
return true;
224+
}
225+
219226
static void srcu_fast_ref_scale_read_section(const int nloops)
220227
{
221228
int i;
@@ -240,7 +247,7 @@ static void srcu_fast_ref_scale_delay_section(const int nloops, const int udl, c
240247
}
241248

242249
static const struct ref_scale_ops srcu_fast_ops = {
243-
.init = rcu_sync_scale_init,
250+
.init = srcu_fast_sync_scale_init,
244251
.readsection = srcu_fast_ref_scale_read_section,
245252
.delaysection = srcu_fast_ref_scale_delay_section,
246253
.name = "srcu-fast"

0 commit comments

Comments
 (0)