[LTP] [PATCH 4/4] mm/oom: enable ksm before OOM-KSM testing

Cyril Hrubis chrubis@suse.cz
Tue Mar 22 14:26:51 CET 2016


Hi!
> +int ksm_run_orig;

This should be declared as local variable in the testoom() function.

>  int max_page_sharing;
>  int merge_across_nodes;
>  
> diff --git a/testcases/kernel/mem/ksm/ksm05.c b/testcases/kernel/mem/ksm/ksm05.c
> index 2baca3b..4037ff3 100644
> --- a/testcases/kernel/mem/ksm/ksm05.c
> +++ b/testcases/kernel/mem/ksm/ksm05.c
> @@ -72,8 +72,6 @@ int TST_TOTAL = 1;
>  
>  #ifdef HAVE_MADV_MERGEABLE
>  
> -static int ksm_run_orig;
> -

And this shouldn't be touched at all.

>  static void sighandler(int sig);
>  
>  int main(int argc, char *argv[])
> diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
> index d37d6a4..0ecde55 100644
> --- a/testcases/kernel/mem/lib/mem.c
> +++ b/testcases/kernel/mem/lib/mem.c
> @@ -224,7 +224,10 @@ void testoom(int mempolicy, int lite, int retcode, int allow_sigkill)
>  			 "skip OOM test for KSM pags");
>  	} else {
>  		tst_resm(TINFO, "start OOM testing for KSM pages.");
> +		SAFE_FILE_SCANF(NULL, PATH_KSM "run", "%d", &ksm_run_orig);
> +		SAFE_FILE_PRINTF(NULL, PATH_KSM "run", "1");
>  		oom(KSM, lite, retcode, allow_sigkill);
> +		FILE_PRINTF(PATH_KSM "run", "%d", ksm_run_orig);
>  	}
>  }

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list