Messages in this thread | | | From | Valentin Schneider <> | Subject | Re: [PATCH v2] sched/rt: fix the case where sched_rt_period_us is negative | Date | Tue, 17 May 2022 15:48:46 +0100 |
| |
On 17/05/22 01:55, Yajun Deng wrote: > May 16, 2022 11:04 PM, "Valentin Schneider" <vschneid@redhat.com> wrote: >>> }, >>> { >>> .procname = "sched_rt_runtime_us", >>> @@ -44,6 +45,8 @@ static struct ctl_table sched_rt_sysctls[] = { >>> .maxlen = sizeof(int), >>> .mode = 0644, >>> .proc_handler = sched_rt_handler, >>> + .extra1 = SYSCTL_NEG_ONE, >>> + .extra2 = (void *)&sysctl_sched_rt_period, >> >> Per this, you could also remove the >> >> ((sysctl_sched_rt_runtime > sysctl_sched_rt_period) || >> >> from sched_rt_global_validate(), no? >> > > No, the extra2 just limit the maximum value of sysctl_sched_rt_runtime is sysctl_sched_rt_period, but not limit the minimum value of sysctl_sched_rt_period is sysctl_sched_rt_runtime. (sysctl_sched_rt_runtime > sysctl_sched_rt_period) can do both.
Gotcha.
> Its purpose is to return error earlier. Perhaps I should remove extra2 to avoid ambiguity. >
It's probably better to only have the "pure" bounds in there yes.
| |