From: "tip-bot2 for Peter Zijlstra" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: perf/core] perf/x86: Mark perf_sample_data __uninitialized
Date: Mon, 23 Nov 2026 10:23:07 -0000 [thread overview]
Message-ID: <179542938764.92412.16102006029806168915.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20261120091258.GH2669272@noisy.programming.kicks-ass.net>
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 86a52e8d105ff74d5fa8c1694df53aa026f7dd62
Gitweb: https://git.kernel.org/tip/86a52e8d105ff74d5fa8c1694df53aa026f7dd62
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Fri, 20 Nov 2026 10:12:58 +01:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 23 Nov 2026 11:13:50 +01:00
perf/x86: Mark perf_sample_data __uninitialized
For consistency; on-stack perf_sample_data shouldn't be initialized.
[ mingo: Annotate them as an optimization. ]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20261120091258.GH2669272@noisy.programming.kicks-ass.net
---
arch/x86/events/amd/core.c | 2 +-
arch/x86/events/amd/ibs.c | 2 +-
arch/x86/events/core.c | 2 +-
arch/x86/events/intel/core.c | 2 +-
arch/x86/events/intel/ds.c | 4 ++--
arch/x86/events/intel/knc.c | 2 +-
arch/x86/events/intel/p4.c | 2 +-
arch/x86/events/zhaoxin/core.c | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
index 49b6b8f..791d435 100644
--- a/arch/x86/events/amd/core.c
+++ b/arch/x86/events/amd/core.c
@@ -958,7 +958,7 @@ static int amd_pmu_v2_handle_irq(struct pt_regs *regs)
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
static atomic64_t status_warned = ATOMIC64_INIT(0);
u64 reserved, status, mask, new_bits, prev_bits;
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
struct hw_perf_event *hwc;
struct perf_event *event;
int handled = 0, idx;
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 66e67e2..6b04fcb 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -1483,7 +1483,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu);
struct perf_event *event = pcpu->event;
struct hw_perf_event *hwc;
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
struct perf_raw_record raw;
struct pt_regs regs;
struct perf_ibs_data ibs_data;
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 4e344fb..c3d6b1c 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -2157,7 +2157,7 @@ void x86_pmu_update_perf_regs(struct perf_event *event,
int x86_pmu_handle_irq(struct pt_regs *regs)
{
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
struct cpu_hw_events *cpuc;
struct perf_event *event;
int idx, handled = 0;
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 0a34d67..e91b5fe 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3819,7 +3819,7 @@ static int x86_pmu_handle_guest_pebs(struct pt_regs *regs,
static int handle_pmi_common(struct pt_regs *regs, u64 status)
{
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
int bit;
int handled = 0;
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index 8444670..f094c6c 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -1184,7 +1184,7 @@ int intel_pmu_drain_bts_buffer(void)
struct bts_record *at, *base, *top;
struct perf_output_handle handle;
struct perf_event_header header;
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
unsigned long skip = 0;
struct pt_regs regs;
@@ -1265,7 +1265,7 @@ unlock:
void intel_pmu_drain_pebs_buffer(void)
{
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
WARN_ON_ONCE(cpuc->enabled);
diff --git a/arch/x86/events/intel/knc.c b/arch/x86/events/intel/knc.c
index e887adc..c8e7e8c 100644
--- a/arch/x86/events/intel/knc.c
+++ b/arch/x86/events/intel/knc.c
@@ -213,7 +213,7 @@ static inline void knc_pmu_ack_status(u64 ack)
static int knc_pmu_handle_irq(struct pt_regs *regs)
{
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
struct cpu_hw_events *cpuc;
int handled = 0;
int bit, loops;
diff --git a/arch/x86/events/intel/p4.c b/arch/x86/events/intel/p4.c
index 5368dc3..e051c18 100644
--- a/arch/x86/events/intel/p4.c
+++ b/arch/x86/events/intel/p4.c
@@ -1033,7 +1033,7 @@ static int p4_pmu_set_period(struct perf_event *event)
static int p4_pmu_handle_irq(struct pt_regs *regs)
{
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
struct cpu_hw_events *cpuc;
struct perf_event *event;
struct hw_perf_event *hwc;
diff --git a/arch/x86/events/zhaoxin/core.c b/arch/x86/events/zhaoxin/core.c
index e506f67..f7d41ca 100644
--- a/arch/x86/events/zhaoxin/core.c
+++ b/arch/x86/events/zhaoxin/core.c
@@ -355,7 +355,7 @@ static void zhaoxin_pmu_enable_event(struct perf_event *event)
*/
static int zhaoxin_pmu_handle_irq(struct pt_regs *regs)
{
- struct perf_sample_data data;
+ struct perf_sample_data data __uninitialized; /* optimization */
struct cpu_hw_events *cpuc;
int handled = 0;
u64 status;
next prev parent reply other threads:[~2026-11-23 10:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 21:10 [PATCH 0/3] perf/core: Fix software event sample data, then stop zeroing it Usama Arif
2026-11-19 21:10 ` [PATCH 1/3] perf/core: Fix perf_sample_data reuse across software events Usama Arif
2026-11-22 22:49 ` [tip: perf/urgent] " tip-bot2 for Usama Arif
2026-11-23 9:44 ` tip-bot2 for Usama Arif
2026-11-19 21:10 ` [PATCH 2/3] perf/core: Don't let BPF programs read an uninitialized sample address Usama Arif
2026-11-22 22:49 ` [tip: perf/urgent] " tip-bot2 for Usama Arif
2026-11-23 9:44 ` tip-bot2 for Usama Arif
2026-11-19 21:10 ` [PATCH 3/3] perf/core: Don't zero perf_sample_data in do_perf_sw_event() Usama Arif
2026-11-20 9:11 ` Peter Zijlstra
2026-11-20 9:12 ` Peter Zijlstra
2026-11-20 20:05 ` Usama Arif
2026-11-23 16:24 ` Usama Arif
2026-11-23 10:23 ` tip-bot2 for Peter Zijlstra [this message]
2026-11-20 20:02 ` Usama Arif
2026-11-23 10:23 ` [tip: perf/core] perf/core: Don't zero perf_sample_data tip-bot2 for Usama Arif
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=179542938764.92412.16102006029806168915.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®