Commit 934487e9 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Andrew Morton

perf/core: fix MAX_ORDER usage in rb_alloc_aux_page()

MAX_ORDER is not inclusive: the maximum allocation order buddy allocator
can deliver is MAX_ORDER-1.

Fix MAX_ORDER usage in rb_alloc_aux_page().

Link: https://lkml.kernel.org/r/20230315113133.11326-7-kirill.shutemov@linux.intel.comSigned-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent fd54349d
...@@ -609,8 +609,8 @@ static struct page *rb_alloc_aux_page(int node, int order) ...@@ -609,8 +609,8 @@ static struct page *rb_alloc_aux_page(int node, int order)
{ {
struct page *page; struct page *page;
if (order > MAX_ORDER) if (order >= MAX_ORDER)
order = MAX_ORDER; order = MAX_ORDER - 1;
do { do {
page = alloc_pages_node(node, PERF_AUX_GFP, order); page = alloc_pages_node(node, PERF_AUX_GFP, order);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment