[LTP] [PATCH v3] tst_test: Add min_runtime to control lower bound of scaled runtime

Li Wang liwang@redhat.com
Thu Jul 17 16:12:17 CEST 2025


On Thu, Jul 17, 2025 at 7:37 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > +     if (tst_test->min_runtime)
> > +             min_runtime = MAX(1, tst_test->min_runtime);
>
> Maybe just:
>         if (tst_test->min_runtime > 0)
>                 min_runtime = tst_test->min_runtime;
>

Yes, the min_runtime type is declared as int so we can avoid using MAX()
here.


>
> >       parse_mul(&runtime_mul, "LTP_RUNTIME_MUL", 0.0099, 100);
> >
> > -     return runtime * runtime_mul;
> > +     return MAX(runtime * runtime_mul, min_runtime);
> >  }
>
> Other than that the approach looks solid to me:
>
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
>

Merged, thanks.

>From now on, we can safely assign a fractional value to LTP_RUNTIME_MUL.


>
> Also sorry for the delay, I was trying to deal with the oldest patches
> that were being ignored in patchwork so I've ignored the newer patches
> for a while.
>

Never mind.

-- 
Regards,
Li Wang


More information about the ltp mailing list