[LTP] [PATCH] syscalls/timer_settime03: Scale interval with clock precision

Li Wang liwang@redhat.com
Thu May 26 12:26:23 CEST 2022


On Wed, May 25, 2022 at 7:29 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> What the test does is to:
>
> - set initial expiration in the past
> - set very small interval value
> - expect the timer to overrun immediatelly many times
>   to trigger timer overrun counter overflow
>
> However the test has harcoded expectation that the kernel timers have
> 1ns resolution. And while that is true for many modern hardware high
> resolution timers are generally not always present.
>
> The test tried to cope with that by adding kernel requirement for
> CONFIG_HIGH_RES_TIMERS=y however that does not necessarily mean that the
> high resolution hardware is present or that the drivers are loaded.
> This only means that the support has been compiled in the kernel.
>
> So instead of disabling the test when kernel timers have lower precision
> we scale the timer interval so that the inverval length divided by the
> timer precision is constant i.e. handler_delay.
>
> Fixes #925
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
>

Reviewed-by: Li Wang <liwang@redhat.com>


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220526/835f8bd8/attachment.htm>


More information about the ltp mailing list