Commit 450d461a authored by Paul E. McKenney's avatar Paul E. McKenney

rcu-tasks: Add kernel boot parameters for callback laziness

This commit adds kernel boot parameters for callback laziness, allowing
the RCU Tasks flavors to be individually adjusted.
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 5ae769c6
...@@ -5293,6 +5293,29 @@ ...@@ -5293,6 +5293,29 @@
A change in value does not take effect until A change in value does not take effect until
the beginning of the next grace period. the beginning of the next grace period.
rcupdate.rcu_tasks_lazy_ms= [KNL]
Set timeout in milliseconds RCU Tasks asynchronous
callback batching for call_rcu_tasks().
A negative value will take the default. A value
of zero will disable batching. Batching is
always disabled for synchronize_rcu_tasks().
rcupdate.rcu_tasks_rude_lazy_ms= [KNL]
Set timeout in milliseconds RCU Tasks
Rude asynchronous callback batching for
call_rcu_tasks_rude(). A negative value
will take the default. A value of zero will
disable batching. Batching is always disabled
for synchronize_rcu_tasks_rude().
rcupdate.rcu_tasks_trace_lazy_ms= [KNL]
Set timeout in milliseconds RCU Tasks
Trace asynchronous callback batching for
call_rcu_tasks_trace(). A negative value
will take the default. A value of zero will
disable batching. Batching is always disabled
for synchronize_rcu_tasks_trace().
rcupdate.rcu_self_test= [KNL] rcupdate.rcu_self_test= [KNL]
Run the RCU early boot self tests Run the RCU early boot self tests
......
...@@ -1083,11 +1083,16 @@ void rcu_barrier_tasks(void) ...@@ -1083,11 +1083,16 @@ void rcu_barrier_tasks(void)
} }
EXPORT_SYMBOL_GPL(rcu_barrier_tasks); EXPORT_SYMBOL_GPL(rcu_barrier_tasks);
int rcu_tasks_lazy_ms = -1;
module_param(rcu_tasks_lazy_ms, int, 0444);
static int __init rcu_spawn_tasks_kthread(void) static int __init rcu_spawn_tasks_kthread(void)
{ {
cblist_init_generic(&rcu_tasks); cblist_init_generic(&rcu_tasks);
rcu_tasks.gp_sleep = HZ / 10; rcu_tasks.gp_sleep = HZ / 10;
rcu_tasks.init_fract = HZ / 10; rcu_tasks.init_fract = HZ / 10;
if (rcu_tasks_lazy_ms >= 0)
rcu_tasks.lazy_jiffies = msecs_to_jiffies(rcu_tasks_lazy_ms);
rcu_tasks.pregp_func = rcu_tasks_pregp_step; rcu_tasks.pregp_func = rcu_tasks_pregp_step;
rcu_tasks.pertask_func = rcu_tasks_pertask; rcu_tasks.pertask_func = rcu_tasks_pertask;
rcu_tasks.postscan_func = rcu_tasks_postscan; rcu_tasks.postscan_func = rcu_tasks_postscan;
...@@ -1236,10 +1241,15 @@ void rcu_barrier_tasks_rude(void) ...@@ -1236,10 +1241,15 @@ void rcu_barrier_tasks_rude(void)
} }
EXPORT_SYMBOL_GPL(rcu_barrier_tasks_rude); EXPORT_SYMBOL_GPL(rcu_barrier_tasks_rude);
int rcu_tasks_rude_lazy_ms = -1;
module_param(rcu_tasks_rude_lazy_ms, int, 0444);
static int __init rcu_spawn_tasks_rude_kthread(void) static int __init rcu_spawn_tasks_rude_kthread(void)
{ {
cblist_init_generic(&rcu_tasks_rude); cblist_init_generic(&rcu_tasks_rude);
rcu_tasks_rude.gp_sleep = HZ / 10; rcu_tasks_rude.gp_sleep = HZ / 10;
if (rcu_tasks_rude_lazy_ms >= 0)
rcu_tasks_rude.lazy_jiffies = msecs_to_jiffies(rcu_tasks_rude_lazy_ms);
rcu_spawn_tasks_kthread_generic(&rcu_tasks_rude); rcu_spawn_tasks_kthread_generic(&rcu_tasks_rude);
return 0; return 0;
} }
...@@ -1856,6 +1866,9 @@ void rcu_barrier_tasks_trace(void) ...@@ -1856,6 +1866,9 @@ void rcu_barrier_tasks_trace(void)
} }
EXPORT_SYMBOL_GPL(rcu_barrier_tasks_trace); EXPORT_SYMBOL_GPL(rcu_barrier_tasks_trace);
int rcu_tasks_trace_lazy_ms = -1;
module_param(rcu_tasks_trace_lazy_ms, int, 0444);
static int __init rcu_spawn_tasks_trace_kthread(void) static int __init rcu_spawn_tasks_trace_kthread(void)
{ {
cblist_init_generic(&rcu_tasks_trace); cblist_init_generic(&rcu_tasks_trace);
...@@ -1870,6 +1883,8 @@ static int __init rcu_spawn_tasks_trace_kthread(void) ...@@ -1870,6 +1883,8 @@ static int __init rcu_spawn_tasks_trace_kthread(void)
if (rcu_tasks_trace.init_fract <= 0) if (rcu_tasks_trace.init_fract <= 0)
rcu_tasks_trace.init_fract = 1; rcu_tasks_trace.init_fract = 1;
} }
if (rcu_tasks_trace_lazy_ms >= 0)
rcu_tasks_trace.lazy_jiffies = msecs_to_jiffies(rcu_tasks_trace_lazy_ms);
rcu_tasks_trace.pregp_func = rcu_tasks_trace_pregp_step; rcu_tasks_trace.pregp_func = rcu_tasks_trace_pregp_step;
rcu_tasks_trace.postscan_func = rcu_tasks_trace_postscan; rcu_tasks_trace.postscan_func = rcu_tasks_trace_postscan;
rcu_tasks_trace.holdouts_func = check_all_holdout_tasks_trace; rcu_tasks_trace.holdouts_func = check_all_holdout_tasks_trace;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment