commit | 8325a284b1fc1efff248b113d8e8a2626955d5b7 | [log] [tgz] |
---|---|---|
author | Ingo Molnar <[email protected]> | Wed Feb 13 06:57:02 2019 |
committer | chrome-bot <[email protected]> | Wed Feb 20 22:45:11 2019 |
tree | bc9ee1242aa43a503b6228f0bc2e3fa6003c0792 | |
parent | 720e311cc8ddca358f65fe1e564ae91ce0f7f036 [diff] |
UPSTREAM: perf/core: Fix impossible ring-buffer sizes warning The following commit: 9dff0aa95a32 ("perf/core: Don't WARN() for impossible ring-buffer sizes") results in perf recording failures with larger mmap areas: root@skl:/tmp# perf record -g -a failed to mmap with 12 (Cannot allocate memory) The root cause is that the following condition is buggy: if (order_base_2(size) >= MAX_ORDER) goto fail; The problem is that @size is in bytes and MAX_ORDER is in pages, so the right test is: if (order_base_2(size) >= PAGE_SHIFT+MAX_ORDER) goto fail; Fix it. Reported-by: "Jin, Yao" <[email protected]> Bisected-by: Borislav Petkov <[email protected]> Analyzed-by: Peter Zijlstra <[email protected]> Cc: Julien Thierry <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: <[email protected]> Fixes: 9dff0aa95a32 ("perf/core: Don't WARN() for impossible ring-buffer sizes") Signed-off-by: Ingo Molnar <[email protected]> (cherry picked from commit 528871b456026e6127d95b1b2bd8e3a003dc1614) BUG=b:124795843 TEST=perf record -g -a Change-Id: I418f2b70c3de76d0c59e7f278107eba4b5d80ba2 Signed-off-by: Guenter Roeck <[email protected]> Reviewed-on: https://chromium-review.googlesource.com/1478048 Reviewed-by: Sean Paul <[email protected]> Reviewed-by: Sonny Rao <[email protected]> Reviewed-by: Yu Zhao <[email protected]> Reviewed-by: Alexey Alexandrov <[email protected]>