From: tangchen <tangchen@cn.fujitsu.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH 05/13]Add some preprocessor variables
Date: Thu, 06 Jan 2011 19:02:14 +0800 [thread overview]
Message-ID: <4D25A136.2020400@cn.fujitsu.com> (raw)
In-Reply-To: <4D259E4A.2050704@cn.fujitsu.com>
KSM is not supported on RHEL5.
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
---
testcases/kernel/mem/ksm/ksm01.c | 18 +++++++++++++++---
testcases/kernel/syscalls/mmap/mmap10.c | 6 +++++-
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/testcases/kernel/mem/ksm/ksm01.c
b/testcases/kernel/mem/ksm/ksm01.c
index 09f71d7..2b10fef 100644
--- a/testcases/kernel/mem/ksm/ksm01.c
+++ b/testcases/kernel/mem/ksm/ksm01.c
@@ -70,11 +70,15 @@
#include "test.h"
#include "usctest.h"
-#define _PATH_KSM "/sys/kernel/mm/ksm/"
-#define MB (1024 * 1024)
char *TCID = "ksm01";
int TST_TOTAL = 1;
+
+#ifdef MADV_MERGEABLE
+
+#define _PATH_KSM "/sys/kernel/mm/ksm/"
+#define MB (1024 * 1024)
+
static int opt_num, opt_size;
static char *opt_numstr, *opt_sizestr;
/* memory pointer to identify per process, MB, and byte like
@@ -536,4 +540,12 @@ void group_check(int run, int pages_shared, int
pages_sharing,
check("pages_unshared", NULL, pages_unshared);
check("sleep_millisecs", NULL, sleep_millisecs);
check("pages_to_scan", NULL, pages_to_scan);
-}
\ No newline at end of file
+}
+
+#else
+int main(int argc, char *argv[])
+{
+ tst_brkm(TRETR, tst_exit, "KSM is unsupported");
+}
+#endif
+
diff --git a/testcases/kernel/syscalls/mmap/mmap10.c
b/testcases/kernel/syscalls/mmap/mmap10.c
index b31975e..e3a158e 100644
--- a/testcases/kernel/syscalls/mmap/mmap10.c
+++ b/testcases/kernel/syscalls/mmap/mmap10.c
@@ -115,9 +115,13 @@ void mmapzero(void)
if (x == MAP_FAILED)
tst_brkm(TBROK|TERRNO, cleanup, "mmap");
if (opt_ksm) {
+#ifdef MADV_MERGEABLE
tst_resm(TINFO, "add to KSM regions.");
if (madvise(x, SIZE+SIZE-4096, MADV_MERGEABLE) == -1)
tst_brkm(TBROK|TERRNO, cleanup, "madvise");
+#else
+ tst_brkm(TRETR, cleanup, "KSM is unsupported.");
+#endif
}
x[SIZE] = 0;
@@ -175,4 +179,4 @@ void help(void)
{
printf(" -a Test anonymous pages\n");
printf(" -s Add to KSM regions\n");
-}
\ No newline at end of file
+}
--
1.7.0.4
--
Best Regards,
Tang chen
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2011-01-06 11:00 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 10:49 [LTP] [PATCH 00/13]Fix a few syntax error tangchen
2011-01-06 10:54 ` [LTP] [PATCH 01/13]Add missing parameters for tst_brkm() tangchen
2011-01-06 18:19 ` Mike Frysinger
2011-01-06 10:56 ` [LTP] [PATCH 02/13]Add " tangchen
2011-01-06 10:58 ` [LTP] [PATCH 03/13]Add a missing ";" tangchen
2011-01-06 11:00 ` [LTP] [PATCH 04/13]Correct the wrong parameters names tangchen
2011-01-06 11:02 ` tangchen [this message]
2011-01-06 18:23 ` [LTP] [PATCH 05/13]Add some preprocessor variables Mike Frysinger
2011-01-06 18:25 ` Garrett Cooper
2011-01-06 11:03 ` [LTP] [PATCH 06/13]Add missing operators tangchen
2011-01-06 19:34 ` Garrett Cooper
2011-01-06 11:05 ` [LTP] [PATCH 07/13]Fix an wrong using of macro WTERMSIG tangchen
2011-01-06 11:06 ` [LTP] [PATCH 08/13]Fix the wrong variable name of wtstatus tangchen
2011-01-06 11:07 ` [LTP] [PATCH 09/13]Add a missing ")" tangchen
2011-01-06 18:22 ` Mike Frysinger
2011-01-06 11:08 ` [LTP] [PATCH 10/13]Remove a redundant "{" tangchen
2011-01-06 18:18 ` Mike Frysinger
2011-01-06 11:10 ` [LTP] [PATCH 11/13]Fix the wrong using of perror() tangchen
2011-01-06 18:21 ` Mike Frysinger
2011-01-06 11:11 ` [LTP] [PATCH 12/13]Add a missing variable TST_TOTAL tangchen
2011-01-06 18:19 ` Mike Frysinger
2011-01-06 11:12 ` [LTP] [PATCH 13/13]Add missing parameters for tst_brkm() tangchen
2011-01-06 18:26 ` [LTP] [PATCH 00/13]Fix a few syntax error Mike Frysinger
2011-01-06 19:35 ` Garrett Cooper
2011-01-06 19:37 ` Garrett Cooper
2011-01-06 20:24 ` Mike Frysinger
2011-01-06 21:05 ` Garrett Cooper
2011-01-06 21:30 ` Mike Frysinger
2011-01-06 21:38 ` Garrett Cooper
2011-01-06 21:46 ` Mike Frysinger
2011-01-07 12:04 ` Garrett Cooper
2011-01-07 14:36 ` Cyril Hrubis
[not found] ` <C4CD5B9F-C198-44A7-996B-3D2C46C4AD86@gmail.com>
2011-01-10 18:43 ` Cyril Hrubis
[not found] ` <AANLkTi=RGbG++FaG4AsZZkrZB14cuKPeuOZZPNVoNvSc@mail.gmail.com>
2011-01-10 20:01 ` Cyril Hrubis
2011-01-13 17:43 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D25A136.2020400@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.