[LTP] [PATCH] mem/lib: keep allocating memory until get an error in single process

Jan Stancek jstancek@redhat.com
Mon Jun 20 12:43:18 CEST 2016



----- Original Message -----
> From: "Li Wang" <liwang@redhat.com>
> To: jstancek@redhat.com
> Cc: ltp@lists.linux.it
> Sent: Monday, 20 June, 2016 11:53:05 AM
> Subject: [PATCH] mem/lib: keep allocating memory until get an error in single process
> 
> We occasionally catch errors like:
> oom03       0  TINFO  :  start OOM testing for KSM pages.
> oom03       0  TINFO  :  expected victim is 3490.
> oom03       6  TFAIL  :  mem.c:163: victim unexpectedly ended with retcode:
> 0, expected: 12
> oom03       0  TINFO  :  set overcommit_memory to 0
> 
> It cames from the caller testoom(0, 1, ENOMEM, 1). The full reason is that
> function child_alloc() go into single process mode, then successfully finish
> the memory allocation and return 0.

Description above doesn't explain why you get 0, when oom03 is set to run
in cgroup with memory.memsw.limit_in_bytes == TESTMEM, and then allocates
TESTMEM + MB.

My guess is a KSM scan merged some pages before you have hit the limit.
Do yo get these failures always during KSM test?

Regards,
Jan

> 
> In this patch, let's make it (in single mode) keep allocating memory with
> an incresed length in order to avoid 0 returned.




More information about the ltp mailing list