Fix: Building the event list fails on fragmented memory
authorMartin Leisener <martin@leisener.de>
Wed, 10 Jun 2015 13:17:37 +0000 (15:17 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 25 Jun 2015 13:30:55 +0000 (09:30 -0400)
commita606b6e893b99bc31cacee98415942dbc577c90c
treee2debaa5c212ba0b257bb12b66fca2101ec7ae82
parent92d9f5e6df0f72842b28ccd303569c88e183325a
Fix: Building the event list fails on fragmented memory

On a small arm imx6 solo with 256MB RAM it often happens that memory
becomes fragmented rather quickly, so that kmalloc will not be able to
get enough consecutive pages (enocuntered for example if you enable all
kernel events: lttng enable-event -k syscall --all).

This patch switches the allocation to vmalloc. Tested for x86 on Ubuntu
12.04 Lts and on imx6 solo 256MB RAM

If this patch is not applied, you can identify low and/or fragmented
memory failures by looking at the kernel ring buffer (please ignore DMA,
it is due to some memory setup misconfiguration, should read Normal):

...
[  321.993820] lttng-sessiond: page allocation failure: order:4, mode:0x1040d0
...
[  321.994711] lowmem_reserve[]: 0 0 0
[  321.994727] DMA: 801*4kB (UEMC) 424*8kB (EMC) 355*16kB (UEMC) 344*32kB (MC) 340*64kB (C) 8*128kB (C) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 46068kB

[ Edit by Mathieu: use vzalloc() rather than vmalloc() + memset 0. ]

Signed-off-by: Martin Leisener <martin@leisener.de>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-events.c
This page took 0.026058 seconds and 4 git commands to generate.