<div dir="ltr"><div>Hi,<br><br>seems this patch haven't totally fix the issue. after applying it, thp05.c still failed on 2 numa  x86_64 system occasionally.<br><br>then I looked into the detail and found that the key point is the parameter which we set to the process is probably too large for some testing systems.<br><br></div><div>I'm trying to make thp05.c get 'nr_thps' values dynamically, but currently I don't have any goodidea. :(<br></div><div><br><br>------<br>$ cat ltp/runtest/mm |grep thp05<br>thp05_1 thp05<br>thp05_2 thp05 -n 10 -N 20<br>thp05_3 thp05 -n 1 -N 300    <-------<br><br>-------<br># cat thp05.c<br>...<br>option_t thp_options[] = {<br>    {"n:", &opt_nr_children, &opt_nr_children_str},<br>    {"N:", &opt_nr_thps, &opt_nr_thps_str},<br>    {NULL, NULL, NULL}<br>};<br><br>static int pre_thp_scan_sleep_millisecs;<br>static int pre_thp_alloc_sleep_millisecs;<br>static char pre_thp_enabled[BUFSIZ];<br><br>int main(int argc, char *argv[])<br>{<br>    int lc;<br>    char *msg;<br>    int nr_children = 2, nr_thps = 64;   <-------<br><br>    tst_parse_opts(argc, argv, thp_options, thp_usage);<br><br>    check_thp_options(&nr_children, &nr_thps);<br><br><br>----<br>cmdline="thp05 -n 1 -N 300"<br>contacts=""<br>analysis=exit<br><<<test_output>>><br>thp05       0  TINFO  :  Start to test transparent hugepage...<br>thp05       0  TINFO  :  There are 1 children allocating 300 transparent hugepages<br>thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...<br>thp05       0  TINFO  :  The current MemFree is 8286MB<br>thp05       0  TINFO  :  child[61793] stop here<br>thp05       0  TINFO  :  Start to test transparent hugepage...<br>thp05       0  TINFO  :  There are 1 children allocating 300 transparent hugepages<br>thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...<br>thp05       0  TINFO  :  The current MemFree is 8286MB<br>thp05       0  TINFO  :  Stop all children...<br>thp05       0  TINFO  :  Start to scan all transparent hugepages...<br>thp05       0  TINFO  :  khugepaged daemon takes 15s to scan all thp pages<br>thp05       0  TINFO  :  Start to verify transparent hugepage size...<br>thp05       1  TFAIL  :  child[61792] got 561152KB thps - expect 614400KB thps<br>thp05       0  TINFO  :  Wake up all children...<br>thp05       0  TINFO  :  THP on MPOL_INTERLEAVE mempolicy...<br>thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes<br>thp05       0  TINFO  :  The current MemFree is 8287MB<br>thp05       0  TINFO  :  child[61914] stop here<br>thp05       0  TINFO  :  Start to test transparent hugepage...<br>thp05       0  TINFO  :  There are 1 children allocating 300 transparent hugepages<br>thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...<br>thp05       0  TINFO  :  The current MemFree is 8286MB<br>thp05       0  TINFO  :  Stop all children...<br>thp05       0  TINFO  :  Start to scan all transparent hugepages...<br>thp05       0  TINFO  :  khugepaged daemon takes 15s to scan all thp pages<br>thp05       0  TINFO  :  Start to verify transparent hugepage size...<br>thp05       1  TFAIL  :  child[61792] got 561152KB thps - expect 614400KB thps<br>thp05       0  TINFO  :  Wake up all children...<br>thp05       0  TINFO  :  THP on MPOL_INTERLEAVE mempolicy...<br>thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes<br>thp05       0  TINFO  :  The current MemFree is 8287MB<br>thp05       0  TINFO  :  Stop all children...<br>thp05       0  TINFO  :  Start to scan all transparent hugepages...<br>thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages<br>thp05       0  TINFO  :  Start to verify transparent hugepage size...<br>thp05       2  TFAIL  :  child[61792] got 612352KB thps - expect 614400KB thps<br>thp05       0  TINFO  :  Wake up all children...<br>thp05       0  TINFO  :  THP on MPOL_PREFERRED mempolicy...<br>thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes<br>thp05       0  TINFO  :  The current MemFree is 8292MB<br>thp05       0  TINFO  :  child[62004] stop here<br>thp05       0  TINFO  :  Start to test transparent hugepage...<br>thp05       0  TINFO  :  There are 1 children allocating 300 transparent hugepages<br>thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...<br>thp05       0  TINFO  :  The current MemFree is 8286MB<br>thp05       0  TINFO  :  Stop all children...<br>thp05       0  TINFO  :  Start to scan all transparent hugepages...<br>thp05       0  TINFO  :  khugepaged daemon takes 15s to scan all thp pages<br>thp05       0  TINFO  :  Start to verify transparent hugepage size...<br>thp05       1  TFAIL  :  child[61792] got 561152KB thps - expect 614400KB thps<br>thp05       0  TINFO  :  Wake up all children...<br>thp05       0  TINFO  :  THP on MPOL_INTERLEAVE mempolicy...<br>thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes<br>thp05       0  TINFO  :  The current MemFree is 8287MB<br>thp05       0  TINFO  :  Stop all children...<br>thp05       0  TINFO  :  Start to scan all transparent hugepages...<br>thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages<br>thp05       0  TINFO  :  Start to verify transparent hugepage size...<br>thp05       2  TFAIL  :  child[61792] got 612352KB thps - expect 614400KB thps<br>thp05       0  TINFO  :  Wake up all children...<br>thp05       0  TINFO  :  THP on MPOL_PREFERRED mempolicy...<br>thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes<br>thp05       0  TINFO  :  The current MemFree is 8292MB<br>thp05       0  TINFO  :  Stop all children...<br>thp05       0  TINFO  :  Start to scan all transparent hugepages...<br>thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages<br>thp05       0  TINFO  :  Start to verify transparent hugepage size...<br>thp05       3  TFAIL  :  child[61792] got 610304KB thps - expect 614400KB thps<br>thp05       0  TINFO  :  Wake up all children...<br><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 26, 2016 at 2:35 PM, Li Wang <span dir="ltr"><<a href="mailto:liwang@redhat.com" target="_blank">liwang@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">Sometime thp05.c fails like:<br>
---<br>
thp05       0  TINFO  :  Stop all children...<br>
thp05       0  TINFO  :  Start to scan all transparent hugepages...<br>
thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages<br>
thp05       0  TINFO  :  Start to verify transparent hugepage size...<br>
thp05       1  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps<br>
thp05       2  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps<br>
thp05       3  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps<br>
thp05       4  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps<br>
---<br>
<br>
Since the system has done much testing work so far as it comes here, it is very easy to<br>
hit the fails if the memory is fragmented, the following tests should better be skiped<br>
while system dose not have enough memory for THP testing.<br>
<br>
Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>><br>
---<br>
 testcases/kernel/mem/lib/mem.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c<br>
index cee4e91..6715c35 100644<br>
--- a/testcases/kernel/mem/lib/mem.c<br>
+++ b/testcases/kernel/mem/lib/mem.c<br>
@@ -773,7 +773,7 @@ void test_transparent_hugepage(int nr_children, int nr_thps,<br>
        memfree = read_meminfo("MemFree:");<br>
        tst_resm(TINFO, "The current MemFree is %luMB", memfree / KB);<br>
        if (memfree < MB)<br>
-               tst_resm(TCONF, "Not enough memory for testing");<br>
+               tst_brkm(TCONF, NULL, "Not enough memory for testing");<br>
<br>
        hugepagesize = read_meminfo("Hugepagesize:");<br>
        tst_resm(TINFO, "The current Hugepagesize is %luMB", hugepagesize / KB);<br>
<span class=""><font color="#888888">--<br>
1.8.3.1<br>
<br>
<br>
--<br>
Mailing list info: <a href="http://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">http://lists.linux.it/listinfo/ltp</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></div>