public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory
@ 2016-01-26  6:35 Li Wang
  2016-01-26  9:14 ` Li Wang
  2016-01-26 11:11 ` Cyril Hrubis
  0 siblings, 2 replies; 6+ messages in thread
From: Li Wang @ 2016-01-26  6:35 UTC (permalink / raw)
  To: ltp

Sometime thp05.c fails like:
---
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       1  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
thp05       2  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
thp05       3  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
thp05       4  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
---

Since the system has done much testing work so far as it comes here, it is very easy to
hit the fails if the memory is fragmented, the following tests should better be skiped
while system dose not have enough memory for THP testing.

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/mem/lib/mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index cee4e91..6715c35 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -773,7 +773,7 @@ void test_transparent_hugepage(int nr_children, int nr_thps,
 	memfree = read_meminfo("MemFree:");
 	tst_resm(TINFO, "The current MemFree is %luMB", memfree / KB);
 	if (memfree < MB)
-		tst_resm(TCONF, "Not enough memory for testing");
+		tst_brkm(TCONF, NULL, "Not enough memory for testing");
 
 	hugepagesize = read_meminfo("Hugepagesize:");
 	tst_resm(TINFO, "The current Hugepagesize is %luMB", hugepagesize / KB);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory
  2016-01-26  6:35 [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory Li Wang
@ 2016-01-26  9:14 ` Li Wang
  2016-01-26 10:17   ` Li Wang
  2016-01-26 11:11 ` Cyril Hrubis
  1 sibling, 1 reply; 6+ messages in thread
From: Li Wang @ 2016-01-26  9:14 UTC (permalink / raw)
  To: ltp

Hi,

seems this patch haven't totally fix the issue. after applying it, thp05.c
still failed on 2 numa  x86_64 system occasionally.

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.

I'm trying to make thp05.c get 'nr_thps' values dynamically, but currently
I don't have any goodidea. :(


------
$ cat ltp/runtest/mm |grep thp05
thp05_1 thp05
thp05_2 thp05 -n 10 -N 20
thp05_3 thp05 -n 1 -N 300    <-------

-------
# cat thp05.c
...
option_t thp_options[] = {
    {"n:", &opt_nr_children, &opt_nr_children_str},
    {"N:", &opt_nr_thps, &opt_nr_thps_str},
    {NULL, NULL, NULL}
};

static int pre_thp_scan_sleep_millisecs;
static int pre_thp_alloc_sleep_millisecs;
static char pre_thp_enabled[BUFSIZ];

int main(int argc, char *argv[])
{
    int lc;
    char *msg;
    int nr_children = 2, nr_thps = 64;   <-------

    tst_parse_opts(argc, argv, thp_options, thp_usage);

    check_thp_options(&nr_children, &nr_thps);


----
cmdline="thp05 -n 1 -N 300"
contacts=""
analysis=exit
<<<test_output>>>
thp05       0  TINFO  :  Start to test transparent hugepage...
thp05       0  TINFO  :  There are 1 children allocating 300 transparent
hugepages
thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...
thp05       0  TINFO  :  The current MemFree is 8286MB
thp05       0  TINFO  :  child[61793] stop here
thp05       0  TINFO  :  Start to test transparent hugepage...
thp05       0  TINFO  :  There are 1 children allocating 300 transparent
hugepages
thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...
thp05       0  TINFO  :  The current MemFree is 8286MB
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 15s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       1  TFAIL  :  child[61792] got 561152KB thps - expect 614400KB
thps
thp05       0  TINFO  :  Wake up all children...
thp05       0  TINFO  :  THP on MPOL_INTERLEAVE mempolicy...
thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes
thp05       0  TINFO  :  The current MemFree is 8287MB
thp05       0  TINFO  :  child[61914] stop here
thp05       0  TINFO  :  Start to test transparent hugepage...
thp05       0  TINFO  :  There are 1 children allocating 300 transparent
hugepages
thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...
thp05       0  TINFO  :  The current MemFree is 8286MB
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 15s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       1  TFAIL  :  child[61792] got 561152KB thps - expect 614400KB
thps
thp05       0  TINFO  :  Wake up all children...
thp05       0  TINFO  :  THP on MPOL_INTERLEAVE mempolicy...
thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes
thp05       0  TINFO  :  The current MemFree is 8287MB
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       2  TFAIL  :  child[61792] got 612352KB thps - expect 614400KB
thps
thp05       0  TINFO  :  Wake up all children...
thp05       0  TINFO  :  THP on MPOL_PREFERRED mempolicy...
thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes
thp05       0  TINFO  :  The current MemFree is 8292MB
thp05       0  TINFO  :  child[62004] stop here
thp05       0  TINFO  :  Start to test transparent hugepage...
thp05       0  TINFO  :  There are 1 children allocating 300 transparent
hugepages
thp05       0  TINFO  :  THP on MPOL_BIND mempolicy...
thp05       0  TINFO  :  The current MemFree is 8286MB
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 15s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       1  TFAIL  :  child[61792] got 561152KB thps - expect 614400KB
thps
thp05       0  TINFO  :  Wake up all children...
thp05       0  TINFO  :  THP on MPOL_INTERLEAVE mempolicy...
thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes
thp05       0  TINFO  :  The current MemFree is 8287MB
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       2  TFAIL  :  child[61792] got 612352KB thps - expect 614400KB
thps
thp05       0  TINFO  :  Wake up all children...
thp05       0  TINFO  :  THP on MPOL_PREFERRED mempolicy...
thp05       0  TINFO  :  The mempolicy need more than 2 numa nodes
thp05       0  TINFO  :  The current MemFree is 8292MB
thp05       0  TINFO  :  Stop all children...
thp05       0  TINFO  :  Start to scan all transparent hugepages...
thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages
thp05       0  TINFO  :  Start to verify transparent hugepage size...
thp05       3  TFAIL  :  child[61792] got 610304KB thps - expect 614400KB
thps
thp05       0  TINFO  :  Wake up all children...


On Tue, Jan 26, 2016 at 2:35 PM, Li Wang <liwang@redhat.com> wrote:

> Sometime thp05.c fails like:
> ---
> thp05       0  TINFO  :  Stop all children...
> thp05       0  TINFO  :  Start to scan all transparent hugepages...
> thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages
> thp05       0  TINFO  :  Start to verify transparent hugepage size...
> thp05       1  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect
> 40960KB thps
> thp05       2  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect
> 40960KB thps
> thp05       3  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect
> 40960KB thps
> thp05       4  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect
> 40960KB thps
> ---
>
> Since the system has done much testing work so far as it comes here, it is
> very easy to
> hit the fails if the memory is fragmented, the following tests should
> better be skiped
> while system dose not have enough memory for THP testing.
>
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>  testcases/kernel/mem/lib/mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/mem/lib/mem.c
> b/testcases/kernel/mem/lib/mem.c
> index cee4e91..6715c35 100644
> --- a/testcases/kernel/mem/lib/mem.c
> +++ b/testcases/kernel/mem/lib/mem.c
> @@ -773,7 +773,7 @@ void test_transparent_hugepage(int nr_children, int
> nr_thps,
>         memfree = read_meminfo("MemFree:");
>         tst_resm(TINFO, "The current MemFree is %luMB", memfree / KB);
>         if (memfree < MB)
> -               tst_resm(TCONF, "Not enough memory for testing");
> +               tst_brkm(TCONF, NULL, "Not enough memory for testing");
>
>         hugepagesize = read_meminfo("Hugepagesize:");
>         tst_resm(TINFO, "The current Hugepagesize is %luMB", hugepagesize
> / KB);
> --
> 1.8.3.1
>
>
> --
> Mailing list info: http://lists.linux.it/listinfo/ltp
>



-- 
Regards,
Li Wang
Email: liwang@redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160126/e7f90c47/attachment-0001.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory
  2016-01-26  9:14 ` Li Wang
@ 2016-01-26 10:17   ` Li Wang
  2016-02-04 16:18     ` Cyril Hrubis
  0 siblings, 1 reply; 6+ messages in thread
From: Li Wang @ 2016-01-26 10:17 UTC (permalink / raw)
  To: ltp

Hi,

I recall a similar testcase thp04.c which had been removed not long ago,
    commit 19cdd120b43aa6a6a4993b61e6ef675d1cdf04b4

after read the words written by Michal Ho, and I found these two (thp04/05)
cases are facing with very similar issue.

now I doubt if we can really trust thp05 result PASS/FAIL for LTP, remove
it or keep using(just reducing the nr_thps value)?

http://article.gmane.org/gmane.linux.ltp/23104


-- 
Regards,
Li Wang
Email: liwang@redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160126/524b144d/attachment.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory
  2016-01-26  6:35 [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory Li Wang
  2016-01-26  9:14 ` Li Wang
@ 2016-01-26 11:11 ` Cyril Hrubis
  2016-01-26 13:00   ` Li Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2016-01-26 11:11 UTC (permalink / raw)
  To: ltp

Hi!
> Sometime thp05.c fails like:
> ---
> thp05       0  TINFO  :  Stop all children...
> thp05       0  TINFO  :  Start to scan all transparent hugepages...
> thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp pages
> thp05       0  TINFO  :  Start to verify transparent hugepage size...
> thp05       1  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
> thp05       2  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
> thp05       3  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps
> thp05       4  TFAIL  :  mem.c:754: child[27099] got 43008KB thps - expect 40960KB thps

Hmm shouldn't the TCONF message be included in the output here?
(otherwise the if wasn't triggered at all)

> ---
> 
> Since the system has done much testing work so far as it comes here, it is very easy to
> hit the fails if the memory is fragmented, the following tests should better be skiped
> while system dose not have enough memory for THP testing.
> 
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>  testcases/kernel/mem/lib/mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
> index cee4e91..6715c35 100644
> --- a/testcases/kernel/mem/lib/mem.c
> +++ b/testcases/kernel/mem/lib/mem.c
> @@ -773,7 +773,7 @@ void test_transparent_hugepage(int nr_children, int nr_thps,
>  	memfree = read_meminfo("MemFree:");
>  	tst_resm(TINFO, "The current MemFree is %luMB", memfree / KB);
>  	if (memfree < MB)
> -		tst_resm(TCONF, "Not enough memory for testing");
> +		tst_brkm(TCONF, NULL, "Not enough memory for testing");

This looks like obvious typo, but we should pass the cleanup to the
tst_brkm() here as the rest of the tst_brkm() in this fuction does.

>  	hugepagesize = read_meminfo("Hugepagesize:");
>  	tst_resm(TINFO, "The current Hugepagesize is %luMB", hugepagesize / KB);

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory
  2016-01-26 11:11 ` Cyril Hrubis
@ 2016-01-26 13:00   ` Li Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Li Wang @ 2016-01-26 13:00 UTC (permalink / raw)
  To: ltp

Hi,

thanks for quick response.

On Tue, Jan 26, 2016 at 7:11 PM, Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > Sometime thp05.c fails like:
> > ---
> > thp05       0  TINFO  :  Stop all children...
> > thp05       0  TINFO  :  Start to scan all transparent hugepages...
> > thp05       0  TINFO  :  khugepaged daemon takes 10s to scan all thp
> pages
> > thp05       0  TINFO  :  Start to verify transparent hugepage size...
> > thp05       1  TFAIL  :  mem.c:754: child[27099] got 43008KB thps -
> expect 40960KB thps
> > thp05       2  TFAIL  :  mem.c:754: child[27099] got 43008KB thps -
> expect 40960KB thps
> > thp05       3  TFAIL  :  mem.c:754: child[27099] got 43008KB thps -
> expect 40960KB thps
> > thp05       4  TFAIL  :  mem.c:754: child[27099] got 43008KB thps -
> expect 40960KB thps
>
> Hmm shouldn't the TCONF message be included in the output here?
> (otherwise the if wasn't triggered at all)
>

yes, it should be triggered first and then print the msg here.

I have realized the TFAIL problem is not simple like that, and I had
already added some comments in the following maillist. Hope you could take
a consideration when you get a chance.

Of course I'm ok if this issue couldn't be solved in the next LTP released,
since the time is short.


> > ---
> >
> > Since the system has done much testing work so far as it comes here, it
> is very easy to
> > hit the fails if the memory is fragmented, the following tests should
> better be skiped
> > while system dose not have enough memory for THP testing.
> >
> > Signed-off-by: Li Wang <liwang@redhat.com>
> > ---
> >  testcases/kernel/mem/lib/mem.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/testcases/kernel/mem/lib/mem.c
> b/testcases/kernel/mem/lib/mem.c
> > index cee4e91..6715c35 100644
> > --- a/testcases/kernel/mem/lib/mem.c
> > +++ b/testcases/kernel/mem/lib/mem.c
> > @@ -773,7 +773,7 @@ void test_transparent_hugepage(int nr_children, int
> nr_thps,
> >       memfree = read_meminfo("MemFree:");
> >       tst_resm(TINFO, "The current MemFree is %luMB", memfree / KB);
> >       if (memfree < MB)
> > -             tst_resm(TCONF, "Not enough memory for testing");
> > +             tst_brkm(TCONF, NULL, "Not enough memory for testing");
>
> This looks like obvious typo, but we should pass the cleanup to the
> tst_brkm() here as the rest of the tst_brkm() in this fuction does.
>
> >       hugepagesize = read_meminfo("Hugepagesize:");
> >       tst_resm(TINFO, "The current Hugepagesize is %luMB", hugepagesize
> / KB);
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>



-- 
Regards,
Li Wang
Email: liwang@redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160126/134ab769/attachment.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory
  2016-01-26 10:17   ` Li Wang
@ 2016-02-04 16:18     ` Cyril Hrubis
  0 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2016-02-04 16:18 UTC (permalink / raw)
  To: ltp

Hi!
> I recall a similar testcase thp04.c which had been removed not long ago,
>     commit 19cdd120b43aa6a6a4993b61e6ef675d1cdf04b4
> 
> after read the words written by Michal Ho, and I found these two (thp04/05)
> cases are facing with very similar issue.
> 
> now I doubt if we can really trust thp05 result PASS/FAIL for LTP, remove
> it or keep using(just reducing the nr_thps value)?
> 
> http://article.gmane.org/gmane.linux.ltp/23104

The test is indeed nearly the same as thp04 and it suffers the same
problem as thp04. Let's remove it (along with the functions from
testcases/kernel/mem/lib/mem.c that would be unused after the removal.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-04 16:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-26  6:35 [LTP] [PATCH] lib/mem.c: exit from test_transparent_hugepage() if shortage of memory Li Wang
2016-01-26  9:14 ` Li Wang
2016-01-26 10:17   ` Li Wang
2016-02-04 16:18     ` Cyril Hrubis
2016-01-26 11:11 ` Cyril Hrubis
2016-01-26 13:00   ` Li Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox