On Thu, 2008-12-11 at 03:06 -0800, CAI Qian wrote:
> Hi,
> 
> Mem01 test case sometimes trigger OOM Killer,
> 
> # ./mem01
> mem01       0  INFO  :  Free Mem:     952 Mb
> mem01       0  INFO  :  Free Swap:    1971 Mb
> mem01       0  INFO  :  Total Free:   2924 Mb
> mem01       0  INFO  :  Total Tested: 2924 Mb
> mem01       0  INFO  :  touching 2924MB of malloc'ed memory (linear)
> Killed
> 
> automount invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0

Yes, we need to avoid OOM Killers in our tests, else we do not serve the
purpose of running all tests. But there is always a tradeoff between how
more to stress, still keeping OOM killer at Bay.

> 
> Call Trace:
>  [<ffffffff800c394f>] out_of_memory+0x8e/0x2f5
>  [<ffffffff8000f2f0>] __alloc_pages+0x245/0x2ce
>  [<ffffffff80012bf5>] __do_page_cache_readahead+0x95/0x1d9
>  [<ffffffff80063a04>] __wait_on_bit_lock+0x5b/0x66
>  [<ffffffff880fbd4d>] :dm_mod:dm_any_congested+0x38/0x3f
>  [<ffffffff80013594>] filemap_nopage+0x148/0x322
>  [<ffffffff80008863>] __handle_mm_fault+0x1f8/0xe5c
>  [<ffffffff80066b9a>] do_page_fault+0x4cb/0x830
>  [<ffffffff80030eea>] do_fork+0x145/0x1be
>  [<ffffffff8005dde9>] error_exit+0x0/0x84
> 
> Node 0 DMA per-cpu:
> cpu 0 hot: high 0, batch 1 used:0
> cpu 0 cold: high 0, batch 1 used:0
> cpu 1 hot: high 0, batch 1 used:0
> cpu 1 cold: high 0, batch 1 used:0
> Node 0 DMA32 per-cpu:
> cpu 0 hot: high 186, batch 31 used:34
> cpu 0 cold: high 62, batch 15 used:53
> cpu 1 hot: high 186, batch 31 used:17
> cpu 1 cold: high 62, batch 15 used:30
> Node 0 Normal per-cpu: empty
> Node 0 HighMem per-cpu: empty
> Free pages:        6084kB (0kB HighMem)
> Active:127104 inactive:116973 dirty:0 writeback:0 unstable:0 free:1521 
> slab:4974 mapped-file:947 mapped-anon:243109 pagetables:2182
> Node 0 DMA free:2128kB min:40kB low:48kB high:60kB active:0kB inactive:0kB 
> present:10724kB pages_scanned:0 all_unreclaimable? yes
> lowmem_reserve[]: 0 993 993 993
> Node 0 DMA32 free:3956kB min:4012kB low:5012kB high:6016kB active:508416kB 
> inactive:467764kB present:1017832kB pages_scanned:6950044 all_unreclaimable? 
> yes
> lowmem_reserve[]: 0 0 0 0
> Node 0 Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB 
> present:0kB pages_scanned:0 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0 0
> Node 0 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB 
> inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0 0
> Node 0 DMA: 4*4kB 4*8kB 2*16kB 4*32kB 4*64kB 1*128kB 2*256kB 0*512kB 1*1024kB 
> 0*2048kB 0*4096kB = 2128kB
> Node 0 DMA32: 1*4kB 0*8kB 3*16kB 2*32kB 0*64kB 0*128kB 1*256kB 1*512kB 
> 1*1024kB 1*2048kB 0*4096kB = 3956kB
> Node 0 Normal: empty
> Node 0 HighMem: empty
> 1275 pagecache pages
> Swap cache: add 5848546, delete 5848271, find 244250/247093, race 1+1
> Free swap  = 0kB
> Total swap = 2064376kB
> Out of memory: Killed process 31159 (mem01).
> 
> As the result, the test failed with a non-error code. This patch 
> reduces the chance of OOM Killer by always reserving 16MB memory. It 
> is a trade-off between not testing all available memory and dealing 
> with false failure (extra work to waive the failure in automated 
> environment and clean up unexpected test leftovers). I prefer the 
> formal.
> 
> Signed-off-by: CAI Qian <[email protected]>

Thanks.

Regards--
Subrata

> 
> --- testcases/kernel/mem/mem/mem01.c.orig     2008-12-11 18:50:46.113160106 
> +0800
> +++ testcases/kernel/mem/mem/mem01.c  2008-12-11 18:53:53.723135288 +0800
> @@ -228,6 +228,8 @@
>      res = (unsigned long long)3*1024*1024*1024;
>  #endif
> 
> +  /* Always reserve 16MB memory to avoid OOM Killer.*/
> +  res -= 16*1024*1024;
>    tst_resm(TINFO, "Total Tested:\t%llu Mb", res/1024/1024);
>    return (size_t)res;
>  }
> 
> 
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Ltp-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ltp-list


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to