[LTP] [PATCH 2/2] starvation: skip test on slow kernel

Li Wang liwang@redhat.com
Fri Jan 3 08:53:09 CET 2025


On Thu, Jan 2, 2025 at 10:31 PM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi Li,
>
> > > Systems with slow kernel configurations may not meet
> > > the performance requirements necessary for the starvation
> > > test to produce valid results.
>
> > > Skipping the test ensures that it runs only on systems
> > > where its results are meaningful.
> > ...
> > > +   if (tst_has_slow_kconfig())
> > > +           tst_brk(TCONF, "Skip test due to slow kernel
> configuration");
> > > +
>
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> > I suppose you have strong reason for this (e.g. it's failing on some slow
> > machine). I'm testing it on emulated riscv64 to see whether it's needed
> to be
> > skipped. Because due CONFIG_LATENCYTOP it will always be skipped on
> Tumbleweed.
>
> OK, I was able to reproduce TFAIL on emulated riscv64, which runs ~ 4m
> 30s, with
> timeout increased to 0h 05m 46s:
>
> tst_tmpdir.c:316: TINFO: Using /tmp/LTP_sta3UIB6E as tmpdir (tmpfs
> filesystem)
> tst_test.c:1893: TINFO: LTP version: 20240930
> tst_test.c:1897: TINFO: Tested kernel: 6.12.6-1-default #1 SMP
> PREEMPT_DYNAMIC Thu Dec 19 17:23:25 UTC 2024 (fb072de) riscv64
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected which
> might slow the execution
> tst_test.c:1728: TINFO: Timeout per run is 0h 02m 00s
> starvation.c:98: TINFO: Setting affinity to CPU 0
> starvation.c:52: TINFO: CPU did 120000000 loops in 226566us
> tst_test.c:1736: TINFO: Updating max runtime to 0h 03m 46s
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected which
> might slow the execution
> tst_test.c:1728: TINFO: Timeout per run is 0h 05m 46s
> starvation.c:148: TFAIL: Scheduller starvation reproduced.
>
> But it works on emulated x86_64.
>
> tst_tmpdir.c:316: TINFO: Using /tmp/LTP_staIt0g73 as tmpdir (tmpfs
> filesystem)
> tst_test.c:1893: TINFO: LTP version: 20240930-148-g4539bfbc7
> tst_test.c:1897: TINFO: Tested kernel: 6.13.0-rc4-1.g4a5c6a6-default #1
> SMP PREEMPT_DYNAMIC Sun Dec 22 22:11:35 UTC 2024 (4a5c6a6) x86_64
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected which
> might slow the execution
> tst_test.c:1728: TINFO: Timeout per run is 0h 02m 00s
> starvation.c:98: TINFO: Setting affinity to CPU 0
> starvation.c:52: TINFO: CPU did 120000000 loops in 34189us
> tst_test.c:1736: TINFO: Updating max runtime to 0h 00m 34s
> tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
> tst_kconfig.c:667: TINFO: CONFIG_LATENCYTOP kernel option detected which
> might slow the execution
> tst_test.c:1728: TINFO: Timeout per run is 0h 02m 34s
> starvation.c:150: TPASS: Haven't reproduced scheduller starvation.
>
> I wonder if we can quit with TCONF only on certain runtime increase. We
> would
> also need to take -l (number of loops into an account).
>

The simplest way is to extend 'max_runtime' when detecting slow configs
for only starvation.c test.

Just multiply the argument of tst_set_max_runtime(timeout) for starvation.c.

I didn't do that because Philip (our Scheduler expert) told me that not much
sense to run this on debug-kernel.
(I don't know that Tumbleweed enables CONFIG_LATENCYTOP by default)


-- 
Regards,
Li Wang


More information about the ltp mailing list