<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 Sat, Oct 12, 2019 at 2:17 PM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</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"><br>
<br>
----- Original Message -----<br>
> Hi Jan,<br>
> <br>
> On Fri, Oct 11, 2019 at 4:24 PM Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>> wrote:<br>
> <br>
> ><br>
> ><br>
> > On Wed, Oct 9, 2019 at 10:43 PM Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>> wrote:<br>
> ><br>
> >> read_all is currently retrying only for short time period and it's<br>
> >> retrying to queue for same worker. If that worker is busy, it easily<br>
> >> hits timeout.<br>
> >><br>
> >> For example 'kernel_page_tables' on aarch64 can take long time to<br>
> >> open/read:<br>
> >> # time dd if=/sys/kernel/debug/kernel_page_tables of=/dev/null count=1<br>
> >> bs=1024<br>
> >> 1+0 records in<br>
> >> 1+0 records out<br>
> >> 1024 bytes (1.0 kB, 1.0 KiB) copied, 13.0531 s, 0.1 kB/s<br>
> >><br>
> >> real 0m13.066s<br>
> >> user 0m0.000s<br>
> >> sys 0m13.059s<br>
> >><br>
> >> Rather than retrying to queue for specific worker, pick any that can<br>
> >> accept<br>
> >> the work and keep trying until we succeed or hit test timeout.<br>
> >><br>
> ><br>
> RFC:<br>
> <br>
> Base on your patch, I'm thinking to achieve a new macro TST_INFILOOP_FUNC<br>
> which can repeat the @FUNC infinitely. Do you feel it satisfies your<br>
> requirements to some degree or meaningful to LTP?<br>
<br>
I'm OK with concept. I'd like more some variation of *RETRY* for name.<br>
Comments below.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Thanks, what about naming: TST_INFI_RETRY_FUNC?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="">And do you mind use it to replace your function work_push_retry()? I know it may be not smarter than work_push_retry() but it looks tiny for code.</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail_default" style="font-size:small">...</span><br>
> +#define TST_INFILOOP_FUNC(FUNC, ERET) \<br>
> + TST_RETRY_FN_EXP_BACKOFF(FUNC, ERET, -1)<br>
> +<br>
> #define TST_RETRY_FN_EXP_BACKOFF(FUNC, ERET, MAX_DELAY) \<br>
> -({ int tst_delay_ = 1; \<br>
> +({ int tst_delay_ = 1, tst_max_delay_ = MAX_DELAY; \<br>
> + if (MAX_DELAY < 0) \<br>
> + tst_max_delay_ *= MAX_DELAY; \<br>
<br>
Shouldn't this be just times (-1). For -5 you get 25 as max sleep time.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Agree.</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> for (;;) { \<br>
> typeof(FUNC) tst_ret_ = FUNC; \<br>
> if (tst_ret_ == ERET) \<br>
> break; \<br>
> - if (tst_delay_ < MAX_DELAY * 1000000) { \<br>
> - usleep(tst_delay_); \<br>
> + usleep(tst_delay_); \<br>
> + if (tst_delay_ < tst_max_delay_ * 1000000) { \<br>
> tst_delay_ *= 2; \<br>
> } else { \<br>
> - tst_brk(TBROK, #FUNC" timed out"); \<br>
> + if (MAX_DELAY > 0) \<br>
<br>
pastebin has this condition backwards, but here it looks ok</blockquote><div><span class="gmail_default" style="font-size:small"></span></div><div><span class="gmail_default" style="font-size:small">Sorry for the typo in pastebin.</span></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>