From: Thomas Gleixner Date: Tue, 30 Nov 2010 17:49:49 +0000 (+0000) Subject: perf session: Keep file mmaped instead of malloc/memcpy X-Git-Tag: v2.6.38-rc1~490^2~59 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe17420784a6d3602e98f798731369fa05936cbe;p=pandora-kernel.git perf session: Keep file mmaped instead of malloc/memcpy Profiling perf with perf revealed that a large part of the processing time is spent in malloc/memcpy/free in the sample ordering code. That code copies the data from the mmap into malloc'ed memory. That's silly. We can keep the mmap and just store the pointer in the queuing data structure. For 64 bit this is not a problem as we map the whole file anyway. On 32bit we keep 8 maps around and unmap the oldest before mmaping the next chunk of the file. Performance gain: 2.95s -> 1.23s (Faktor 2.4) Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Frederic Weisbecker LKML-Reference: <20101130163820.278787719@linutronix.de> Signed-off-by: Thomas Gleixner Signed-off-by: Arnaldo Carvalho de Melo --- Reading git-diff-tree failed