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

Cyril Hrubis chrubis@suse.cz
Thu Mar 31 15:52:05 CEST 2016


Hi!
>  void testoom(int mempolicy, int lite, int retcode, int allow_sigkill)
>  {
> +	int ksm_run_orig;
> +
>  	set_global_mempolicy(mempolicy);
>  
>  	tst_resm(TINFO, "start normal OOM testing.");
> @@ -224,7 +226,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(cleanup, PATH_KSM "run", "%d", &ksm_run_orig);
> +		SAFE_FILE_PRINTF(cleanup, PATH_KSM "run", "1");
>  		oom(KSM, lite, retcode, allow_sigkill);
> +		SAFE_FILE_PRINTF(cleanup,PATH_KSM "run", "%d", ksm_run_orig);
                                         ^
					 missing space

Technically the oom() can actually exit the test execution (calls
tst_brkm()) so it would be a bit better if the value was restored in the
test cleanup. But I guess that it's unlikely to happen and we can
proceed with this patch.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list