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

Christopher Covington cov at codeaurora.org
Wed Jul 1 09:40:21 PDT 2015


On 07/01/2015 11:32 AM, Laurent Dufour wrote:
> 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>

Reviewed-by: Christopher Covington <cov at codeaurora.org>

> 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";
>  
> 


-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


More information about the CRIU mailing list