[CRIU] [PATCH 1/4] test/zdtm: Do not use hard coded PAGE_SIZE value

Laurent Dufour ldufour at linux.vnet.ibm.com
Wed Jul 1 08:32:37 PDT 2015


Since the page size may be different from an architecture/a system to
another it should not be hard coded to 4096.

As a consequence, several tests are failing on ppc64 due to a wrong page
size value.

This fix belongs to sysconf to get the current page size.

Signed-off-by: Laurent Dufour <ldufour at linux.vnet.ibm.com>
---
 test/zdtm/lib/zdtmtst.h             | 3 ++-
 test/zdtm/live/transition/maps007.c | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/lib/zdtmtst.h b/test/zdtm/lib/zdtmtst.h
index 28ee53612807..69de1ec3f00b 100644
--- a/test/zdtm/lib/zdtmtst.h
+++ b/test/zdtm/lib/zdtmtst.h
@@ -2,9 +2,10 @@
 #define _VIMITESU_H_
 
 #include <sys/types.h>
+#include <unistd.h>
 
 #ifndef PAGE_SIZE
-# define PAGE_SIZE 4096
+# define PAGE_SIZE (unsigned int)(sysconf(_SC_PAGESIZE))
 #endif
 
 #ifndef PR_SET_CHILD_SUBREAPER
diff --git a/test/zdtm/live/transition/maps007.c b/test/zdtm/live/transition/maps007.c
index 0b6dadb631ec..e3cfb7670276 100644
--- a/test/zdtm/live/transition/maps007.c
+++ b/test/zdtm/live/transition/maps007.c
@@ -14,7 +14,6 @@
 
 #define MAP_SIZE (1UL << 20)
 #define MEM_SIZE (1UL << 29)
-#define PAGE_SIZE 4096
 
 const char *test_doc	= "create random mappings and touch memory";
 
-- 
1.9.1



More information about the CRIU mailing list