<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Cyril Hrubis <<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>> wrote:<br></div></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/include/tst_fuzzy_sync.h b/include/tst_fuzzy_sync.h<br>
index 4f09ed416..bef424002 100644<br>
--- a/include/tst_fuzzy_sync.h<br>
+++ b/include/tst_fuzzy_sync.h<br>
@@ -160,15 +160,6 @@ struct tst_fzsync_pair {<br>
int b_cntr;<br>
/** Internal; Used by tst_fzsync_pair_exit() and fzsync_pair_wait() */<br>
int exit;<br>
- /**<br>
- * The maximum desired execution time as a proportion of the timeout<br>
- *<br>
- * A value x so that 0 < x < 1 which decides how long the test should<br>
- * be run for (assuming the loop limit is not exceeded first).<br>
- *<br>
- * Defaults to 0.5 (~150 seconds with default timeout).<br>
- */<br>
- float exec_time_p;<br>
/** Internal; The test time remaining on tst_fzsync_pair_reset() */<br>
float exec_time_start;<br>
/**<br>
@@ -214,7 +205,6 @@ static inline void tst_fzsync_pair_init(struct tst_fzsync_pair *pair)<br>
CHK(avg_alpha, 0, 1, 0.25);<br>
CHK(min_samples, 20, INT_MAX, 1024);<br>
CHK(max_dev_ratio, 0, 1, 0.1);<br>
- CHK(exec_time_p, 0, 1, 0.5);<br>
CHK(exec_loops, 20, INT_MAX, 3000000);<br>
<br>
if (tst_ncpus_available() <= 1)<br>
@@ -291,7 +281,7 @@ static inline void tst_fzsync_pair_reset(struct tst_fzsync_pair *pair,<br>
if (run_b)<br>
SAFE_PTHREAD_CREATE(&pair->thread_b, 0, run_b, 0);<br>
<br>
- pair->exec_time_start = (float)tst_timeout_remaining();<br>
+ pair->exec_time_start = (float)tst_remaining_runtime();<br>
}<br>
<br>
/**<br>
@@ -644,10 +634,9 @@ static inline void tst_fzsync_wait_b(struct tst_fzsync_pair *pair)<br>
*/<br>
static inline int tst_fzsync_run_a(struct tst_fzsync_pair *pair)<br>
{<br>
- float rem_p = 1 - tst_timeout_remaining() / pair->exec_time_start;<br>
+ float rem_p = 1 - tst_remaining_runtime() / pair->exec_time_start;<br>
<br>
- if ((pair->exec_time_p * SAMPLING_SLICE < rem_p)<br>
- && (pair->sampling > 0)) {<br>
+ if ((SAMPLING_SLICE < rem_p) && (pair->sampling > 0)) {<br>
tst_res(TINFO, "Stopped sampling at %d (out of %d) samples, "<br>
"sampling time reached 50%% of the total time limit",<br>
pair->exec_loop, pair->min_samples);<br>
@@ -655,7 +644,7 @@ static inline int tst_fzsync_run_a(struct tst_fzsync_pair *pair)<br>
tst_fzsync_pair_info(pair);<br>
}<br>
<br>
- if (pair->exec_time_p < rem_p) {<br>
+ if (rem_p >= 1) {<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">I hit a new problem while testing new pty03, that seems here</div><div class="gmail_default" style="font-size:small">will fall into an infinite loop and test timed out finally. The printf</div><div class="gmail_default" style="font-size:small">shows rem_p will be overflow I haven't figured out why.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But with comparing with 0.9, it always gets passed on to the same system.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--- a/include/tst_fuzzy_sync.h<br>+++ b/include/tst_fuzzy_sync.h<br>@@ -644,7 +644,7 @@ static inline int tst_fzsync_run_a(struct tst_fzsync_pair *pair)<br> tst_fzsync_pair_info(pair);<br> }<br> <br>- if (rem_p >= 1) {<br>+ if (rem_p >= 0.9) {<br> tst_res(TINFO,<br> "Exceeded execution time, requesting exit");<br> tst_atomic_store(1, &pair->exit);<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">----------------------</div><div class="gmail_default" style="font-size:small"># ./pty03<br>...<br>../../../include/tst_fuzzy_sync.h:295: TINFO: start_a - start_b: { avg = -90ns, avg_dev = 8ns, dev_ratio = 0.09 }<br>../../../include/tst_fuzzy_sync.h:295: TINFO: end_a - start_a : { avg = 2606ns, avg_dev = 127ns, dev_ratio = 0.05 }<br>../../../include/tst_fuzzy_sync.h:295: TINFO: end_b - start_b : { avg = 8785ns, avg_dev = 600ns, dev_ratio = 0.07 }<br>../../../include/tst_fuzzy_sync.h:295: TINFO: end_a - end_b : { avg = -6269ns, avg_dev = 566ns, dev_ratio = 0.09 }<br>../../../include/tst_fuzzy_sync.h:295: TINFO: spins : { avg = 3269 , avg_dev = 200 , dev_ratio = 0.06 }<br>Test timeouted, sending SIGKILL!<br>tst_test.c:1573: TINFO: If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1<br>tst_test.c:1575: TBROK: Test killed! (timeout?)<br></div><div class="gmail_default" style="font-size:small"><br></div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>