<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 15, 2019 at 6:09 PM Cyril Hrubis <<a href="mailto:chrubis@suse.cz">chrubis@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
> >> int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout)<br>
> >> {<br>
> >> struct timespec timeout;<br>
> >> + int ret;<br>
> >><br>
> >> if (id >= tst_max_futexes) {<br>
> >> errno = EOVERFLOW;<br>
> >> @@ -94,8 +95,12 @@ int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout)<br>
> >> timeout.tv_sec = msec_timeout/1000;<br>
> >> timeout.tv_nsec = (msec_timeout%1000) * 1000000;<br>
> >><br>
> >> - return syscall(SYS_futex, &tst_futexes[id], FUTEX_WAIT,<br>
> >> - tst_futexes[id], &timeout);<br>
> >> + do {<br>
> >> + ret = syscall(SYS_futex, &tst_futexes[id], FUTEX_WAIT,<br>
> >> + tst_futexes[id], &timeout);<br>
> ><br>
> > if (ret == -1 && errno == EINTR)<br>
> > tst_res(TWARN | TERRNO, "FUTEX_WAIT operation was interrupted by a signal, retry again");<br>
> ><br>
> <br>
> I am not sure if this warning message is desired for test-cases which<br>
> needs to wait on checkpoints irrespective of signals like this<br>
> tgkill01 test-case.<br>
<br>
Agreed, it's not an error condition, it's just a coincidence that most<br>
of the tests does not get signals when they sleep on futex, otherwise<br>
thing would crash and burn. So I would argue that retrying on EINTR is<br>
actually a bug fix rather than anything else.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Okay, here I'm not insist to print the warning. But it's only use for hint on that worst situation which you were mentioned. If the checkpoint got signal leads to never timeout and test eventually killed by test lib. That would hard to know what happened at that moment. My concern is the situation is hard to reproduce later so just want to print more useful messeges:).</div></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>