[LTP] [PATCH V3] lib: multiply the max_runtime if detect slow kconfigs
Li Wang
liwang@redhat.com
Thu Dec 19 14:12:01 CET 2024
On Thu, Dec 19, 2024 at 9:07 PM Petr Vorel <pvorel@suse.cz> wrote:
> > Hi!
>
> > On 12. 12. 24 7:04, Li Wang wrote:
> > > The method adjusts the max_runtime for test cases by multiplying
> > > it by a factor (4x) if any slower kernel options are detected.
> > > Debug kernel configurations (such as CONFIG_KASAN,
> CONFIG_PROVE_LOCKING, etc.)
> > > are known to degrade performance, and this adjustment ensures
> > > that tests do not fail prematurely due to timeouts.
>
> > > As Cyril pointed out that a debug kernel will typically run
> > > slower by a factor of N, and while determining the exact value
> > > of N is challenging, so a reasonable upper bound is sufficient
> > > for practical purposes.
>
> > > Signed-off-by: Li Wang <liwang@redhat.com>
> > > ---
> > > include/tst_kconfig.h | 13 +++++++++++++
> > > lib/tst_kconfig.c | 39 +++++++++++++++++++++++++++++++++++++++
> > > lib/tst_test.c | 3 +++
> > > 3 files changed, 55 insertions(+)
>
> > > <snip>
>
> > > diff --git a/lib/tst_test.c b/lib/tst_test.c
> > > index 8db554dea..f4e667240 100644
> > > --- a/lib/tst_test.c
> > > +++ b/lib/tst_test.c
> > > @@ -555,6 +555,9 @@ static int multiply_runtime(int max_runtime)
> > > parse_mul(&runtime_mul, "LTP_RUNTIME_MUL", 0.0099, 100);
> > > + if (tst_has_slow_kconfig())
> > > + max_runtime *= 4;
> > > +
> > > return max_runtime * runtime_mul;
> > > }
>
> > We have plenty of tests which keep looping until they run out of runtime
> and
> > then automatically stop. These tests are not at risk of timing out and
> this
> > patch only makes them run 3 times longer than necessary.
>
We can bypass the multiply when recognizing those test.
>
> > I'd recommend temporarily reverting this patch and adding it back with a
> new
> > tst_test flag to identify tests which exit when runtime expires.
>
> +1. Li, could you please do it?
>
Sure, but I am wondering do you running the latest LTP branch in productive
env?
If so I am sorry to make the test time prolong.
Or if not, could you give me a period to resolve it in a new patch?
--
Regards,
Li Wang
More information about the ltp
mailing list