<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 27, 2018 at 10:06 PM, Jan Stancek <span dir="ltr"><<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Most systems can complete this reproducer in standard test time.<br>
Small groups of systems (e.g. aarch64 with 512M hugepages) can hit<br>
a timeout.<br>
<br>
Add a check for elapsed time and end test early if we are getting close (80%).<br>
<br>
Fixes: <div class="gmail_default" style="font-size:small;display:inline"></div>#387<br>
<br>
Signed-off-by: Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</a>><br>
---<br>
testcases/kernel/syscalls/<wbr>move_pages/move_pages12.c | 20 ++++++++++++++------<br>
1 file changed, 14 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/testcases/kernel/syscalls/<wbr>move_pages/move_pages12.c b/testcases/kernel/syscalls/<wbr>move_pages/move_pages12.c<br>
index c0ff27114110..2813097871e4 100644<br>
--- a/testcases/kernel/syscalls/<wbr>move_pages/move_pages12.c<br>
+++ b/testcases/kernel/syscalls/<wbr>move_pages/move_pages12.c<br>
@@ -40,6 +40,7 @@<br>
#include <sys/wait.h><br>
<br>
#include "tst_test.h"<br>
+#include "tst_timer.h"<br>
#include "move_pages_support.h"<br>
#include "lapi/mmap.h"<br>
<br>
@@ -51,6 +52,7 @@<br>
#define PATH_HUGEPAGES "/sys/kernel/mm/hugepages/"<br>
#define TEST_PAGES 2<br>
#define TEST_NODES 2<br>
+#define TEST_TIMEOUT 300<br>
<br>
static int pgsz, hpsz;<br>
static long orig_hugepages = -1;<br>
@@ -102,6 +104,8 @@ static void do_test(void)<br>
pid_t cpid = -1;<br>
int status;<br>
<br>
+ tst_timer_start(CLOCK_<wbr>MONOTONIC);<br>
+<br>
addr = SAFE_MMAP(NULL, TEST_PAGES * hpsz, PROT_READ | PROT_WRITE,<br>
MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0);<br>
<br>
@@ -123,14 +127,15 @@ static void do_test(void)<br>
memset(addr, 0, TEST_PAGES * hpsz);<br>
<br>
SAFE_MUNMAP(addr, TEST_PAGES * hpsz);<br>
- }<br>
<br>
- if (i == LOOPS) {<br>
- SAFE_KILL(cpid, SIGKILL);<br>
- SAFE_WAITPID(cpid, &status, 0);<br>
- if (!WIFEXITED(status))<br>
- tst_res(TPASS, "Bug not reproduced");<br>
+ if (tst_timer_expired_ms(<div class="gmail_default" style="font-size:small;display:inline"></div>TEST_<wbr>TIMEOUT))<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">This is a good way for solving <div class="gmail_default" style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline"></div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">#387 issue, but </span>that will make the</div><div class="gmail_default" style="font-size:small">LTP_TIMEOUT_MUL out of action even if someone set a value to it.</div><div class="gmail_default" style="font-size:small">because test will always stop on <div class="gmail_default" style="display:inline"></div>TEST_<wbr>TIMEOUT expired every time.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Shouldn't we consider this situation? </div></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div>
</div></div>