<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:49 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"><span class="gmail_default" style="font-size:small">...</span><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>
> ><br>
> <br>
> Thanks, what about naming: TST_INFI_RETRY_FUNC?<br>
<br>
Or just keep TST_RETRY_FUNC and add parameter to it?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Sounds better, we could add parameter @INFI to control the retry as a knob.</div></div><div><br></div><div><div class="gmail_default" style="font-size:small">/* @INFI - 1: retry infinitely, 0: retry in limit times */</div></div><div class="gmail_default" style="font-size:small"><br></div><div><div class="gmail_default" style="font-size:small">#define TST_RETRY_FUNC(FUNC, ERET, INFI) \</div> <span class="gmail_default" style="font-size:small"> </span>TST_RETRY_FN_EXP_BACKOFF(FUNC, ERET, 1, INFI)<br><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>
> And do you mind use it to replace your function work_push_retry()? I know<br>
> it may be not smarter than work_push_retry() but it looks tiny for code.<br>
<br>
It may need some wrapper, because work_push_retry() may be passing different<br>
argument to function on each retry, which was one of reasons for the patch.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I was not meaning to hack the work_push_retry() function, I mean to change your patch as below after we improve the TST_RETRY_FUNC. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"># git diff .<br>diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c<br>index 3dac20e..ccbc5eb 100644<br>--- a/testcases/kernel/fs/read_all/read_all.c<br>+++ b/testcases/kernel/fs/read_all/read_all.c<br>@@ -292,7 +292,7 @@ static void stop_workers(void)<br> <br> for (i = 0; i < worker_count; i++) {<br> if (workers[i].q)<br>- TST_RETRY_FUNC(queue_push(workers[i].q, stop_code), 1);<br>+ TST_RETRY_FUNC(queue_push(workers[i].q, stop_code), 1, 1);<br> }<br> <br> for (i = 0; i < worker_count; i++) {<br>@@ -310,7 +310,7 @@ static void rep_sched_work(const char *path, int rep)<br> for (i = j = 0; i < rep; i++, j++) {<br> if (j >= worker_count)<br> j = 0;<br>- TST_RETRY_FUNC(queue_push(workers[j].q, path), 1);<br>+ TST_RETRY_FUNC(queue_push(workers[j].q, path), 1, 1);<br> }<br> }<br></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>