diff options
author | Yajun Deng <yajun.deng@linux.dev> | 2023-10-08 04:15:38 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2023-10-09 12:44:56 +0200 |
commit | 089768dfeb3ab294f9ab6a1f2462001f0f879fbb (patch) | |
tree | ef1f71ca63d7a74a1918e12b3476919de446fce0 /kernel/sched/rt.c | |
parent | sched/nohz: Remove unnecessarily complex error handling pattern from find_new... (diff) | |
download | linux-089768dfeb3ab294f9ab6a1f2462001f0f879fbb.tar.xz linux-089768dfeb3ab294f9ab6a1f2462001f0f879fbb.zip |
sched/rt: Change the type of 'sysctl_sched_rt_period' from 'unsigned int' to 'int'
Doing this matches the natural type of 'int' based calculus
in sched_rt_handler(), and also enables the adding in of a
correct upper bounds check on the sysctl interface.
[ mingo: Rewrote the changelog. ]
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20231008021538.3063250-1-yajun.deng@linux.dev
Diffstat (limited to 'kernel/sched/rt.c')
-rw-r--r-- | kernel/sched/rt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 88fc98601413..76d82a096e03 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -16,7 +16,7 @@ struct rt_bandwidth def_rt_bandwidth; * period over which we measure -rt task CPU usage in us. * default: 1s */ -unsigned int sysctl_sched_rt_period = 1000000; +int sysctl_sched_rt_period = 1000000; /* * part of the period that we allow rt tasks to run in us. @@ -34,7 +34,7 @@ static struct ctl_table sched_rt_sysctls[] = { { .procname = "sched_rt_period_us", .data = &sysctl_sched_rt_period, - .maxlen = sizeof(unsigned int), + .maxlen = sizeof(int), .mode = 0644, .proc_handler = sched_rt_handler, .extra1 = SYSCTL_ONE, @@ -47,7 +47,7 @@ static struct ctl_table sched_rt_sysctls[] = { .mode = 0644, .proc_handler = sched_rt_handler, .extra1 = SYSCTL_NEG_ONE, - .extra2 = SYSCTL_INT_MAX, + .extra2 = (void *)&sysctl_sched_rt_period, }, { .procname = "sched_rr_timeslice_ms", |