<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Richard Palethorpe <<a href="mailto:rpalethorpe@suse.de">rpalethorpe@suse.de</a>> wrote:<br></div></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>  <br>
>  Practically speaking we have to assume a large amount of time has passed<br>
>  when using ITIMER_REAL. It has to be *much* larger than a VM is likely<br>
>  to be paused for and then successfully resumed. Or the amount of time a<br>
>  clock may be corrected by (for e.g. with NTP).<br>
><br>
> Hmm, not sure if I understand correctly above, will that<br>
> timer value be out of the range but reasonable?<br>
><br>
> Or is there any additional situation we should cover?<br>
<br>
Sorry that is confusing.<br>
<br>
The question is what happens if the clock jumps backwards?<br>
<br>
I don't see anything which says it_value.tv_sec can't go out of<br>
range. OTOH I would expect it to compensate for large jumps in time.<br>
<br>
If the test randomly fails because it_value.tv_sec > time_sec then what<br>
action will we take?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">How about increasing the time_sec on virtual machine?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Seems no perfect way to completely resolve but only reducing</div><div class="gmail_default" style="font-size:small">the odds of happening. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Or do you have another better suggestion?</div><div class="gmail_default" style="font-size:small"><br></div>--- a/testcases/kernel/syscalls/setitimer/setitimer01.c<br>+++ b/testcases/kernel/syscalls/setitimer/setitimer01.c<br>@@ -142,6 +142,11 @@ static void setup(void)<br> <br>        time_sec  = 9 + time_step / 1000;<br>        time_usec = 3 * time_step;<br>+<br>+       if (tst_is_virt(VIRT_ANY)) {<br>+               tst_res(TINFO, "Running in a VM, multiply the time_sec by 10.");<br>+               time_sec *= 10;<br>+       }<br> }<br><div class="gmail_default" style="font-size:small"></div><br></div><div> </div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>