From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Wang Date: Sat, 12 Oct 2019 15:28:02 +0800 Subject: [LTP] [PATCH v2] read_all: retry to queue work for any worker In-Reply-To: <23965038.5952515.1570862960195.JavaMail.zimbra@redhat.com> References: <26d555b1d9deddb5a6f0a93a7c7d3b00e8abc1ff.1570616598.git.jstancek@redhat.com> <8c5d507fd19bc3110561ed1c666b7ac47442e09e.1570632125.git.jstancek@redhat.com> <1445930938.5951899.1570861051806.JavaMail.zimbra@redhat.com> <23965038.5952515.1570862960195.JavaMail.zimbra@redhat.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it On Sat, Oct 12, 2019 at 2:49 PM Jan Stancek wrote: > ... > > > > Base on your patch, I'm thinking to achieve a new macro > TST_INFILOOP_FUNC > > > > which can repeat the @FUNC infinitely. Do you feel it satisfies your > > > > requirements to some degree or meaningful to LTP? > > > > > > I'm OK with concept. I'd like more some variation of *RETRY* for name. > > > Comments below. > > > > > > > Thanks, what about naming: TST_INFI_RETRY_FUNC? > > Or just keep TST_RETRY_FUNC and add parameter to it? > Sounds better, we could add parameter @INFI to control the retry as a knob. /* @INFI - 1: retry infinitely, 0: retry in limit times */ #define TST_RETRY_FUNC(FUNC, ERET, INFI) \ TST_RETRY_FN_EXP_BACKOFF(FUNC, ERET, 1, INFI) > > > > 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. > > It may need some wrapper, because work_push_retry() may be passing > different > argument to function on each retry, which was one of reasons for the patch. > 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. # git diff . diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c index 3dac20e..ccbc5eb 100644 --- a/testcases/kernel/fs/read_all/read_all.c +++ b/testcases/kernel/fs/read_all/read_all.c @@ -292,7 +292,7 @@ static void stop_workers(void) for (i = 0; i < worker_count; i++) { if (workers[i].q) - TST_RETRY_FUNC(queue_push(workers[i].q, stop_code), 1); + TST_RETRY_FUNC(queue_push(workers[i].q, stop_code), 1, 1); } for (i = 0; i < worker_count; i++) { @@ -310,7 +310,7 @@ static void rep_sched_work(const char *path, int rep) for (i = j = 0; i < rep; i++, j++) { if (j >= worker_count) j = 0; - TST_RETRY_FUNC(queue_push(workers[j].q, path), 1); + TST_RETRY_FUNC(queue_push(workers[j].q, path), 1, 1); } } -- Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: