From: sashiko-bot@kernel.org
To: "Yuehong Wu" <wuyuehong@cmss.chinamobile.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf/x86/intel/ds: don't WARN when the BTS buffer can't be allocated
Date: Fri, 06 Nov 2026 03:17:45 +0000 [thread overview]
Message-ID: <sashiko-outbox-200641@kernel.org> (raw)
In-Reply-To: <20261105-perf-ds-bts-warn-1-yuehongwu@cmss.chinamobile.com>
> alloc_bts_buffer() asks for the buffer with __GFP_NOWARN and then WARNs
> if the allocation failed anyway. The failure is already handled: the
> caller disables BTS for the event and releases what was set up, and
> perf_event_open() returns -ENOMEM.
>
> The WARN_ONCE() came with commit 4485154138f6 ("perf/x86/intel: Avoid
> spamming kernel log for BTS buffer failure"), which added __GFP_NOWARN to
> stop the log spam of the failing per-CPU allocation but kept one warning
> as a hint. That hint is fatal under panic_on_warn: on a machine with
> BTS, the 64 KiB buffer allocation can fail on a memory-constrained
> system and a plain perf_event_open() then panics the kernel. Since the
> allocation explicitly asked not to warn and the error path is fine, drop
> the WARN_ONCE().
>
> Reproduced on 7.3.0-next-20261027 by making the page allocator fail the
> order-4 BTS buffer allocation (fail_page_alloc: min-order=4,
> ignore-gfp-wait=0). Without this change the first perf_event_open() of
> a hardware event hits the warning and, with panic_on_warn=1, panics.
> With this change the same allocation failure is silent: BTS is disabled
> and a following branches/period=1 event returns -EOPNOTSUPP, while the
> kernel keeps running. The buffer is allocated per possible CPU,
> independently of any specific BTS event, so the failure path is
> exercised without BTS tracing.
>
> Fixes: 4485154138f6 ("perf/x86/intel: Avoid spamming kernel log for BTS buffer failure")
> Signed-off-by: Yuehong Wu <wuyuehong@cmss.chinamobile.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261105-perf-ds-bts-warn-1-yuehongwu@cmss.chinamobile.com?part=1
prev parent reply other threads:[~2026-11-06 3:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 3:06 [PATCH] perf/x86/intel/ds: don't WARN when the BTS buffer can't be allocated Yuehong Wu
2026-11-06 3:17 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-200641@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wuyuehong@cmss.chinamobile.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox