diff options
author | Ingo Molnar <[email protected]> | 2019-02-13 07:57:02 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2019-02-13 08:05:02 +0100 |
commit | 528871b456026e6127d95b1b2bd8e3a003dc1614 (patch) | |
tree | 40fffe3693bad8ba2b7284a8cd861116835cfce7 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 81ec3f3c4c4d78f2d3b6689c9816bfbdf7417dbb (diff) |
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]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions