From: Cyril H. <su...@li...> - 2013-04-30 15:21:25
|
The branch, master, has been updated via f2ec5c633c1b50e5affa5488148a196358fb1de6 (commit) from d27f4b35eb108b4895478beeb9c20356b82f5147 (commit) - Log ----------------------------------------------------------------- commit f2ec5c633c1b50e5affa5488148a196358fb1de6 Author: Cyril Hrubis <ch...@su...> Date: Tue Apr 30 16:29:43 2013 +0200 mem/thp03: Return TCONF if KSM is not supported The madvise() with MADV_MERGEABLE will return EINVAL when kernel is not compiled with KSM. Make the test return TCONF rather than TBROK in this case. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/mem/thp/thp03.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/mem/thp/thp03.c b/testcases/kernel/mem/thp/thp03.c index 8b54243..a9faa93 100644 --- a/testcases/kernel/mem/thp/thp03.c +++ b/testcases/kernel/mem/thp/thp03.c @@ -44,6 +44,7 @@ #include <fcntl.h> #include <stdlib.h> #include <string.h> +#include <errno.h> #include "mem.h" #include "safe_macros.h" #include "test.h" @@ -93,8 +94,15 @@ static void thp_test(void) memset(p, 0x00, unaligned_size); if (mprotect(p, unaligned_size, PROT_NONE) == -1) tst_brkm(TBROK | TERRNO, cleanup, "mprotect"); - if (madvise(p + hugepage_size, page_size, MADV_MERGEABLE) == -1) - tst_brkm(TBROK | TERRNO, cleanup, "madvise"); + + if (madvise(p + hugepage_size, page_size, MADV_MERGEABLE) == -1) { + if (errno == EINVAL) { + tst_brkm(TCONF, cleanup, + "MADV_MERGEABLE is not enabled/supported"); + } else { + tst_brkm(TBROK | TERRNO, cleanup, "madvise"); + } + } switch (fork()) { case -1: hooks/post-receive -- ltp |