[LTP] [PATCH v2] sched: add sched sysctl sanity test

Petr Vorel petr.vorel@gmail.com
Tue Jan 9 20:24:44 CET 2024


Hi Cyril,

It looks like the second fix 079be8fc6309 ("sched/rt: Disallow writing invalid
values to sched_rt_period_us") is not in stable, shouldn't be there?

> Currently the test fails due to kernel bug, I will send patch to LKML
> later on.

> The problem with kernel is that sysctl_sched_rt_period is unsigned int
> but it's processed with proc_dointvec() which means that you are allowed
> to write negative values into the variable even though documentation
> says it shouldn't be possible and the kernel code asserts that rt_period
> is > 0.

> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---

> - Fixed a few whitespaces
> - Added second kernel commit into metadata
nit: metadata of the git commit looks ugly, but we would need to agree on better
solution.

>  runtest/sched                                 |   2 +
>  testcases/kernel/sched/sysctl/.gitignore      |   1 +
>  testcases/kernel/sched/sysctl/Makefile        |   7 +
>  .../kernel/sched/sysctl/proc_sched_rt01.c     | 122 ++++++++++++++++++
>  4 files changed, 132 insertions(+)
>  create mode 100644 testcases/kernel/sched/sysctl/.gitignore
>  create mode 100644 testcases/kernel/sched/sysctl/Makefile
>  create mode 100644 testcases/kernel/sched/sysctl/proc_sched_rt01.c

> diff --git a/runtest/sched b/runtest/sched
> index 172fe4174..3457114f4 100644
> --- a/runtest/sched
> +++ b/runtest/sched
> @@ -16,3 +16,5 @@ sched_cli_serv run_sched_cliserv.sh
>  sched_stress sched_stress.sh

>  autogroup01 autogroup01
> +
> +proc_sched_rt01

This should obviously be:
proc_sched_rt01 proc_sched_rt01

And I would move it above sched_stress.sh.

The rest LGTM, thanks!
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr


More information about the ltp mailing list