Skip to content

Commit 450d461

Browse files
committed
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: Paul E. McKenney <[email protected]>
1 parent 5ae769c commit 450d461

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5293,6 +5293,29 @@
52935293
A change in value does not take effect until
52945294
the beginning of the next grace period.
52955295

5296+
rcupdate.rcu_tasks_lazy_ms= [KNL]
5297+
Set timeout in milliseconds RCU Tasks asynchronous
5298+
callback batching for call_rcu_tasks().
5299+
A negative value will take the default. A value
5300+
of zero will disable batching. Batching is
5301+
always disabled for synchronize_rcu_tasks().
5302+
5303+
rcupdate.rcu_tasks_rude_lazy_ms= [KNL]
5304+
Set timeout in milliseconds RCU Tasks
5305+
Rude asynchronous callback batching for
5306+
call_rcu_tasks_rude(). A negative value
5307+
will take the default. A value of zero will
5308+
disable batching. Batching is always disabled
5309+
for synchronize_rcu_tasks_rude().
5310+
5311+
rcupdate.rcu_tasks_trace_lazy_ms= [KNL]
5312+
Set timeout in milliseconds RCU Tasks
5313+
Trace asynchronous callback batching for
5314+
call_rcu_tasks_trace(). A negative value
5315+
will take the default. A value of zero will
5316+
disable batching. Batching is always disabled
5317+
for synchronize_rcu_tasks_trace().
5318+
52965319
rcupdate.rcu_self_test= [KNL]
52975320
Run the RCU early boot self tests
52985321

kernel/rcu/tasks.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,11 +1083,16 @@ void rcu_barrier_tasks(void)
10831083
}
10841084
EXPORT_SYMBOL_GPL(rcu_barrier_tasks);
10851085

1086+
int rcu_tasks_lazy_ms = -1;
1087+
module_param(rcu_tasks_lazy_ms, int, 0444);
1088+
10861089
static int __init rcu_spawn_tasks_kthread(void)
10871090
{
10881091
cblist_init_generic(&rcu_tasks);
10891092
rcu_tasks.gp_sleep = HZ / 10;
10901093
rcu_tasks.init_fract = HZ / 10;
1094+
if (rcu_tasks_lazy_ms >= 0)
1095+
rcu_tasks.lazy_jiffies = msecs_to_jiffies(rcu_tasks_lazy_ms);
10911096
rcu_tasks.pregp_func = rcu_tasks_pregp_step;
10921097
rcu_tasks.pertask_func = rcu_tasks_pertask;
10931098
rcu_tasks.postscan_func = rcu_tasks_postscan;
@@ -1236,10 +1241,15 @@ void rcu_barrier_tasks_rude(void)
12361241
}
12371242
EXPORT_SYMBOL_GPL(rcu_barrier_tasks_rude);
12381243

1244+
int rcu_tasks_rude_lazy_ms = -1;
1245+
module_param(rcu_tasks_rude_lazy_ms, int, 0444);
1246+
12391247
static int __init rcu_spawn_tasks_rude_kthread(void)
12401248
{
12411249
cblist_init_generic(&rcu_tasks_rude);
12421250
rcu_tasks_rude.gp_sleep = HZ / 10;
1251+
if (rcu_tasks_rude_lazy_ms >= 0)
1252+
rcu_tasks_rude.lazy_jiffies = msecs_to_jiffies(rcu_tasks_rude_lazy_ms);
12431253
rcu_spawn_tasks_kthread_generic(&rcu_tasks_rude);
12441254
return 0;
12451255
}
@@ -1856,6 +1866,9 @@ void rcu_barrier_tasks_trace(void)
18561866
}
18571867
EXPORT_SYMBOL_GPL(rcu_barrier_tasks_trace);
18581868

1869+
int rcu_tasks_trace_lazy_ms = -1;
1870+
module_param(rcu_tasks_trace_lazy_ms, int, 0444);
1871+
18591872
static int __init rcu_spawn_tasks_trace_kthread(void)
18601873
{
18611874
cblist_init_generic(&rcu_tasks_trace);
@@ -1870,6 +1883,8 @@ static int __init rcu_spawn_tasks_trace_kthread(void)
18701883
if (rcu_tasks_trace.init_fract <= 0)
18711884
rcu_tasks_trace.init_fract = 1;
18721885
}
1886+
if (rcu_tasks_trace_lazy_ms >= 0)
1887+
rcu_tasks_trace.lazy_jiffies = msecs_to_jiffies(rcu_tasks_trace_lazy_ms);
18731888
rcu_tasks_trace.pregp_func = rcu_tasks_trace_pregp_step;
18741889
rcu_tasks_trace.postscan_func = rcu_tasks_trace_postscan;
18751890
rcu_tasks_trace.holdouts_func = check_all_holdout_tasks_trace;

0 commit comments

Comments
 (0)