* [RFC PATCH] perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err()
@ 2026-08-27 6:55 Sergey Senozhatsky
2026-08-27 6:59 ` Sergey Senozhatsky
2026-08-27 7:02 ` sashiko-bot
0 siblings, 2 replies; 4+ messages in thread
From: Sergey Senozhatsky @ 2026-08-27 6:55 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, x86,
linux-perf-users, linux-kernel, Sergey Senozhatsky
We see alloc_bts_buffer() allocation failures under memory pressure,
while those allocation failures are non-fatal the WARN_ONCE() triggers
our fleet monitoring. Given that alloc_bts_buffer() can be called from
various paths (e.g. syscall() or kvm_emulate_wrmsr()) and fail multiple
times, there seem to be little value in that one single backtrace (for
first allocation failure only).
Downgrade WARN_ONCE() to pr_err_once().
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
arch/x86/events/intel/ds.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index 8940f0292229..29c24b2925a7 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -918,7 +918,7 @@ static int alloc_bts_buffer(int cpu)
buffer = dsalloc_pages(BTS_BUFFER_SIZE, GFP_KERNEL | __GFP_NOWARN, cpu);
if (unlikely(!buffer)) {
- WARN_ONCE(1, "%s: BTS buffer allocation failure\n", __func__);
+ pr_err_once(1, "%s: BTS buffer allocation failure\n", __func__);
return -ENOMEM;
}
hwev->ds_bts_vaddr = buffer;
--
2.55.0.897.gb25b4bd76c-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC PATCH] perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err()
2026-08-27 6:55 [RFC PATCH] perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err() Sergey Senozhatsky
@ 2026-08-27 6:59 ` Sergey Senozhatsky
2026-08-27 10:20 ` Sergey Senozhatsky
2026-08-27 7:02 ` sashiko-bot
1 sibling, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2026-08-27 6:59 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, x86, linux-perf-users, linux-kernel
On (26/08/27 15:55), Sergey Senozhatsky wrote:
> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
> index 8940f0292229..29c24b2925a7 100644
> --- a/arch/x86/events/intel/ds.c
> +++ b/arch/x86/events/intel/ds.c
> @@ -918,7 +918,7 @@ static int alloc_bts_buffer(int cpu)
>
> buffer = dsalloc_pages(BTS_BUFFER_SIZE, GFP_KERNEL | __GFP_NOWARN, cpu);
> if (unlikely(!buffer)) {
> - WARN_ONCE(1, "%s: BTS buffer allocation failure\n", __func__);
> + pr_err_once(1, "%s: BTS buffer allocation failure\n", __func__);
^^^ compile-testing patches? Haven't heard of that...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH] perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err()
2026-08-27 6:55 [RFC PATCH] perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err() Sergey Senozhatsky
2026-08-27 6:59 ` Sergey Senozhatsky
@ 2026-08-27 7:02 ` sashiko-bot
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-08-27 7:02 UTC (permalink / raw)
To: Sergey Senozhatsky; +Cc: linux-perf-users
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Replacing `WARN_ONCE(1, ...)` with `pr_err_once(1, ...)` without removing the condition argument causes a build failure.
--
commit e234f9d8f1cd00344467d9d8095e6f5f291f3900
Author: Sergey Senozhatsky <senozhatsky@chromium.org>
perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err()
This commit downgrades the BTS buffer allocation failure warning from
WARN_ONCE to pr_err_once to prevent triggering fleet monitoring alarms
under memory pressure.
> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
> index 91a093d8cf2e7..02ec21ebb7af2 100644
> --- a/arch/x86/events/intel/ds.c
> +++ b/arch/x86/events/intel/ds.c
> @@ -918,7 +918,7 @@ static int alloc_bts_buffer(int cpu)
>
> buffer = dsalloc_pages(BTS_BUFFER_SIZE, GFP_KERNEL | __GFP_NOWARN, cpu);
> if (unlikely(!buffer)) {
> - WARN_ONCE(1, "%s: BTS buffer allocation failure\n", __func__);
> + pr_err_once(1, "%s: BTS buffer allocation failure\n", __func__);
[Severity: Low]
Does this cause a build failure? Unlike WARN_ONCE which takes a condition
as its first argument, pr_err_once expects the format string as its first
argument. Leaving the integer 1 here will attempt to concatenate the KERN_ERR
macro string literal with an integer during expansion, which usually results
in a compile-time syntax error.
> return -ENOMEM;
> }
> hwev->ds_bts_vaddr = buffer;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827065529.3835720-1-senozhatsky@chromium.org?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH] perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err()
2026-08-27 6:59 ` Sergey Senozhatsky
@ 2026-08-27 10:20 ` Sergey Senozhatsky
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Senozhatsky @ 2026-08-27 10:20 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, x86, linux-perf-users, linux-kernel
On (26/08/27 15:59), Sergey Senozhatsky wrote:
> On (26/08/27 15:55), Sergey Senozhatsky wrote:
> > diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
> > index 8940f0292229..29c24b2925a7 100644
> > --- a/arch/x86/events/intel/ds.c
> > +++ b/arch/x86/events/intel/ds.c
> > @@ -918,7 +918,7 @@ static int alloc_bts_buffer(int cpu)
> >
> > buffer = dsalloc_pages(BTS_BUFFER_SIZE, GFP_KERNEL | __GFP_NOWARN, cpu);
> > if (unlikely(!buffer)) {
> > - WARN_ONCE(1, "%s: BTS buffer allocation failure\n", __func__);
> > + pr_err_once(1, "%s: BTS buffer allocation failure\n", __func__);
I guess also can just remove it altogether.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-27 10:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 6:55 [RFC PATCH] perf/x86/intel: downgrade alloc_bts_buffer() WARN() to pr_err() Sergey Senozhatsky
2026-08-27 6:59 ` Sergey Senozhatsky
2026-08-27 10:20 ` Sergey Senozhatsky
2026-08-27 7:02 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox