From: Jiri Olsa Date: Tue, 19 Mar 2013 14:35:09 +0000 (+0100) Subject: perf: Fix vmalloc ring buffer pages handling X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~35^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5919b30933d7c4fac1f214c59f26c5e990044f09;p=pandora-kernel.git perf: Fix vmalloc ring buffer pages handling If we allocate perf ring buffer with the size of single (user) page, we will get memory corruption when releasing itin rb_free_work function (for CONFIG_PERF_USE_VMALLOC option). For single page sized ring buffer the page_order is -1 (because nr_pages is 0). This needs to be recognized in the rb_free_work function to release proper amount of pages. Adding data_page_nr function that returns number of allocated data pages. Customizing the rest of the code to use it. Reported-by: Jan Stancek Original-patch-by: Peter Zijlstra Acked-by: Peter Zijlstra Cc: Corey Ashford Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Signed-off-by: Jiri Olsa Link: http://lkml.kernel.org/r/20130319143509.GA1128@krava.brq.redhat.com Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed