<div dir="ltr">Hello Cyril,<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 5, 2016 at 1:30 AM, Cyril Hrubis <span dir="ltr"><<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</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">Hi!<br>
> +#ifdef __x86_64__<br>
<br>
Last question, why do we limit the test to x86_64?<br>
<br>
Since apart from hardcoded page size, there does not seem to be anything<br>
x86_64 specific at all.<br></blockquote><div><br></div><div>Thanks for reminding me, limit the test program to x86_64 because the bug was detected on that platform, I did not noticed the portable issue.<br><br></div><div>If the following changes test good(bug reproduced) on other platform, I will post V4.<br></div><div><br></div><div>v3 ---> v4<br></div><div>------------<br>$ git diff<br>diff --git a/testcases/kernel/syscalls/madvise/madvise06.c b/testcases/kernel/syscalls/madvise/madvise06.c<br>index 44a40ba..41e51f9 100644<br>--- a/testcases/kernel/syscalls/madvise/madvise06.c<br>+++ b/testcases/kernel/syscalls/madvise/madvise06.c<br>@@ -43,10 +43,7 @@<br> char *TCID = "madvise06";<br> int TST_TOTAL = 1;<br> <br>-#ifdef __x86_64__<br>-<br> #define GB_SZ (1024*1024*1024)<br>-#define PG_SZ (4*1024)<br> <br> static long dst_max;<br> <br>@@ -100,7 +97,7 @@ static int get_page_fault_num(void)<br> <br> static void test_advice_willneed(void)<br> {<br>- int i;<br>+ int i, pg_sz;<br> char *src;<br> char *dst[100];<br> int page_fault_num_1;<br>@@ -124,8 +121,9 @@ static void test_advice_willneed(void)<br> <br> tst_resm(TINFO, "PageFault(no madvice): %d", get_page_fault_num());<br> <br>+ pg_sz = getpagesize();<br> /* Do madvice() to dst[0] */<br>- TEST(madvise(dst[0], PG_SZ, MADV_WILLNEED));<br>+ TEST(madvise(dst[0], pg_sz, MADV_WILLNEED));<br> if (TEST_RETURN == -1)<br> tst_brkm(TBROK | TERRNO, NULL, "madvise failed");<br> <br>@@ -147,11 +145,3 @@ static void test_advice_willneed(void)<br> for (i = 0; i < dst_max; ++i)<br> SAFE_MUNMAP(NULL, dst[i], 1 * GB_SZ);<br> }<br>-<br>-<br>-#else<br>-int main(void)<br>-{<br>- tst_brkm(TCONF, NULL, "Only test on x86_64.");<br>-}<br>-#endif<br><br></div><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>
Otherwise the test looks fine.<br>
<span class=""><font color="#888888"><br>
--<br>
Cyril Hrubis<br>
<a href="mailto:chrubis@suse.cz">chrubis@suse.cz</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Regards,<br></div>Li Wang<br></div><div>Email: <a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a><br></div></div></div></div></div></div>
</div></div>