From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: Richard Palethorpe <rpalethorpe@suse.com>,
LTP List <ltp@lists.linux.it>,
automated-testing@lists.yoctoproject.org
Subject: Re: [LTP] [PATCH v3 22/29] fuzzy_sync: Convert to runtime
Date: Fri, 13 May 2022 14:20:40 +0200 [thread overview]
Message-ID: <Yn5NGPpfoddFYTs2@yuki> (raw)
In-Reply-To: <CAEemH2dAfUEjA877h0Lwy9Qw12YgQ6zgQbf1BJemyr7=xfj0Rg@mail.gmail.com>
Hi!
> > diff --git a/include/tst_fuzzy_sync.h b/include/tst_fuzzy_sync.h
> > index 4f09ed416..bef424002 100644
> > --- a/include/tst_fuzzy_sync.h
> > +++ b/include/tst_fuzzy_sync.h
> > @@ -160,15 +160,6 @@ struct tst_fzsync_pair {
> > int b_cntr;
> > /** Internal; Used by tst_fzsync_pair_exit() and
> > fzsync_pair_wait() */
> > int exit;
> > - /**
> > - * The maximum desired execution time as a proportion of the
> > timeout
> > - *
> > - * A value x so that 0 < x < 1 which decides how long the test
> > should
> > - * be run for (assuming the loop limit is not exceeded first).
> > - *
> > - * Defaults to 0.5 (~150 seconds with default timeout).
> > - */
> > - float exec_time_p;
> > /** Internal; The test time remaining on tst_fzsync_pair_reset() */
> > float exec_time_start;
> > /**
> > @@ -214,7 +205,6 @@ static inline void tst_fzsync_pair_init(struct
> > tst_fzsync_pair *pair)
> > CHK(avg_alpha, 0, 1, 0.25);
> > CHK(min_samples, 20, INT_MAX, 1024);
> > CHK(max_dev_ratio, 0, 1, 0.1);
> > - CHK(exec_time_p, 0, 1, 0.5);
> > CHK(exec_loops, 20, INT_MAX, 3000000);
> >
> > if (tst_ncpus_available() <= 1)
> > @@ -291,7 +281,7 @@ static inline void tst_fzsync_pair_reset(struct
> > tst_fzsync_pair *pair,
> > if (run_b)
> > SAFE_PTHREAD_CREATE(&pair->thread_b, 0, run_b, 0);
> >
> > - pair->exec_time_start = (float)tst_timeout_remaining();
> > + pair->exec_time_start = (float)tst_remaining_runtime();
> > }
> >
> > /**
> > @@ -644,10 +634,9 @@ static inline void tst_fzsync_wait_b(struct
> > tst_fzsync_pair *pair)
> > */
> > static inline int tst_fzsync_run_a(struct tst_fzsync_pair *pair)
> > {
> > - float rem_p = 1 - tst_timeout_remaining() / pair->exec_time_start;
> > + float rem_p = 1 - tst_remaining_runtime() / pair->exec_time_start;
> >
> > - if ((pair->exec_time_p * SAMPLING_SLICE < rem_p)
> > - && (pair->sampling > 0)) {
> > + if ((SAMPLING_SLICE < rem_p) && (pair->sampling > 0)) {
> > tst_res(TINFO, "Stopped sampling at %d (out of %d)
> > samples, "
> > "sampling time reached 50%% of the total time
> > limit",
> > pair->exec_loop, pair->min_samples);
> > @@ -655,7 +644,7 @@ static inline int tst_fzsync_run_a(struct
> > tst_fzsync_pair *pair)
> > tst_fzsync_pair_info(pair);
> > }
> >
> > - if (pair->exec_time_p < rem_p) {
> > + if (rem_p >= 1) {
> >
>
> I hit a new problem while testing new pty03, that seems here
> will fall into an infinite loop and test timed out finally. The printf
> shows rem_p will be overflow I haven't figured out why.
>
> But with comparing with 0.9, it always gets passed on to the same system.
That is strange, since we do:
rem_p = 1 - tst_remaining_runtime()/pair->time_exec_start;
And the tst_remaining_runtime() should return 0 once the time is up so
the end result should be that rem_p will end up 1 sooner or later.
Anyways we can as well use the value from tst_remainig_runtime()
directly instead as:
diff --git a/include/tst_fuzzy_sync.h b/include/tst_fuzzy_sync.h
index bef424002..db5bec7a4 100644
--- a/include/tst_fuzzy_sync.h
+++ b/include/tst_fuzzy_sync.h
@@ -634,7 +634,8 @@ static inline void tst_fzsync_wait_b(struct tst_fzsync_pair *pair)
*/
static inline int tst_fzsync_run_a(struct tst_fzsync_pair *pair)
{
- float rem_p = 1 - tst_remaining_runtime() / pair->exec_time_start;
+ int remaining_runtime = tst_remaining_runtime();
+ float rem_p = 1 - remaining_runtime / pair->exec_time_start;
if ((SAMPLING_SLICE < rem_p) && (pair->sampling > 0)) {
tst_res(TINFO, "Stopped sampling at %d (out of %d) samples, "
@@ -644,7 +645,7 @@ static inline int tst_fzsync_run_a(struct tst_fzsync_pair *pair)
tst_fzsync_pair_info(pair);
}
- if (rem_p >= 1) {
+ if (!remaining_runtime) {
tst_res(TINFO,
"Exceeded execution time, requesting exit");
tst_atomic_store(1, &pair->exit);
Does that fix your problem?
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-05-13 12:18 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 12:37 [LTP] [PATCH v3 00/29] Introduce runtime and conver tests Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 01/29] Introduce a concept of max runtime Cyril Hrubis
2022-05-14 4:21 ` Li Wang
2022-05-24 9:25 ` [LTP] [Automated-testing] " Richard Palethorpe
2022-05-12 12:37 ` [LTP] [PATCH v3 02/29] mtest06/mmap1: Convert to runtime Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 03/29] mtest06/mmap3: " Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 04/29] mtest01/mtest01: " Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 05/29] cve/cve-2015-3290: " Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 06/29] crypto/af_alg02: " Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 07/29] crypto/pcrypt_aead01: " Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 08/29] syscalls/clock_gettime01: Remove useless timeout Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 09/29] syscalls/fanotify22: " Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 10/29] syscalls/gettimeofday02: Convert to runtime Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 11/29] syscalls/inotify06: " Cyril Hrubis
2022-05-12 12:37 ` [LTP] [PATCH v3 12/29] syscalls/inotify01: Remove now useless timeout Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 13/29] syscalls/perf_event_open03: Convert to runtime Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 14/29] syscalls/readv01: Remove now useless timeout Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 15/29] syscalls/tgkill03: Remove now unused timeout Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 16/29] syscalls/setsockopt09: Remove now useless timeout Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 17/29] syscalls/userfaultfd01: " Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 18/29] syscalls/move_pages12: Convert to runtime Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 19/29] syscalls/rt_sigqueueinfo01: Remove now useless timeout Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 20/29] mem/mallocstress: Convert to runtime Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 21/29] mem/{oom, min_free_kbytes}: " Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 22/29] fuzzy_sync: " Cyril Hrubis
2022-05-13 9:13 ` Li Wang
2022-05-13 12:20 ` Cyril Hrubis [this message]
2022-05-13 13:08 ` Li Wang
2022-05-13 14:22 ` Cyril Hrubis
2022-05-14 2:59 ` Li Wang
2022-05-16 7:52 ` Richard Palethorpe
2022-05-17 10:56 ` Cyril Hrubis
2022-05-17 11:07 ` [LTP] [Automated-testing] " Petr Vorel
2022-05-17 12:28 ` [LTP] " Li Wang
2022-05-18 7:47 ` Li Wang
2022-05-19 9:05 ` Cyril Hrubis
2022-05-19 10:02 ` Li Wang
2022-05-19 10:27 ` Cyril Hrubis
2022-05-19 10:29 ` Li Wang
2022-05-19 12:01 ` Cyril Hrubis
2022-05-24 9:24 ` Richard Palethorpe
2022-05-12 12:38 ` [LTP] [PATCH v3 23/29] ltp-aiodio/dio_sparse, aiodio_sparse: " Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 24/29] ltp-aiodio/read_checkzero: Remove Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 25/29] ltp-aiodio/dio_{truncate, append}: Convert to runtime Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 26/29] ltp-aiodio/dio_read: " Cyril Hrubis
2022-05-24 8:36 ` Petr Vorel
2022-05-12 12:38 ` [LTP] [PATCH v3 27/29] timer_test: " Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 28/29] ltp-aiodio/aiodio_append: " Cyril Hrubis
2022-05-12 12:38 ` [LTP] [PATCH v3 29/29] tst_test: Remove timeout stubs Cyril Hrubis
2022-05-20 8:36 ` [LTP] [PATCH 0/2] two follow up fix for Introduce-of-max-runtime Li Wang
2022-05-20 8:36 ` [LTP] [PATCH 1/2] testcases: make use of runtime Li Wang
2022-05-20 11:03 ` Cyril Hrubis
2022-05-20 11:15 ` Li Wang
2022-05-20 8:36 ` [LTP] [PATCH 2/2] mmap3: reset runtime to 10s Li Wang
2022-05-20 11:05 ` Cyril Hrubis
2022-05-20 11:24 ` Li Wang
2022-05-20 12:18 ` [LTP] [PATCH 0/2] two follow up fix for Introduce-of-max-runtime Cyril Hrubis
2022-05-20 12:51 ` Li Wang
2022-05-20 12:55 ` Petr Vorel
2022-05-24 8:39 ` [LTP] [PATCH v3 00/29] Introduce runtime and conver tests Petr Vorel
2022-05-24 8:41 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yn5NGPpfoddFYTs2@yuki \
--to=chrubis@suse.cz \
--cc=automated-testing@lists.yoctoproject.org \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.