Re: [BUG] WARNING in __alloc_frozen_pages_noprof
From: Peter Zijlstra
Date: Wed Nov 26 2025 - 06:19:33 EST
On Wed, Nov 26, 2025 at 10:46:38AM +0100, Vlastimil Babka wrote:
> +CC perf people as AFAIU the problem originates there. Should the limit
> be lowered, or the allocations e.g. switched to kvmalloc, to avoid
> requesting impossibly high order allocations?
>
> /*
> * There are several places where we assume that the order value is sane
> * so bail out early if the request is out of bound.
> */
> if (WARN_ON_ONCE_GFP(order > MAX_PAGE_ORDER, gfp))
> return NULL;
>
>
>
> On 11/19/25 10:07 AM, Xianying Wang wrote:
> > Hi,
> >
> > I hit the following warning in the page allocator when opening a perf
> > event with callchain sampling after increasing
> > kernel.perf_event_max_stack.This warning can be triggered by first
> > writing a large value into kernel.perf_event_max_stack and then
> > opening a perf event with callchain sampling enabled.
> >
> > The reproducer does two things:
> >
> > 1) It writes a large (but still accepted) value to the sysctl:
> >
> > echo 0x40132 > /proc/sys/kernel/perf_event_max_stack
> >
Yeah, that is far too large. I suppose the actual max is somewhere near
8k, which would give 64k data for just the callchain -- given that a
single perf buffer entry is limited to 64k (IIRC) and all that.