Skip to content

Commit 07aa8f3

Browse files
Ravi Bangoriagregkh
authored andcommitted
perf/amd/ibs: Account interrupt for discarded samples
[ Upstream commit 01336b5 ] Add interrupt throttling accounting for below cases: o IBS Op PMU: A software filter (in addition to the hardware filter) drops samples whose load latency is below the user-specified threshold. o IBS Fetch PMU: Samples discarded due to the zero-RIP erratum (#1197). Although these samples are discarded, the NMI cost is still incurred, so they should be counted for interrupt throttling. Fixes: 26db2e0 ("perf/x86/amd/ibs: Work around erratum #1197") Fixes: d20610c ("perf/amd/ibs: Add support for OP Load Latency Filtering") Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: https://patch.msgid.link/20260216042216.1440-2-ravi.bangoria@amd.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 10e8834 commit 07aa8f3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

arch/x86/events/amd/ibs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,10 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
12931293
* within [128, 2048] range.
12941294
*/
12951295
if (!op_data3.ld_op || !op_data3.dc_miss ||
1296-
op_data3.dc_miss_lat <= (event->attr.config1 & 0xFFF))
1296+
op_data3.dc_miss_lat <= (event->attr.config1 & 0xFFF)) {
1297+
throttle = perf_event_account_interrupt(event);
12971298
goto out;
1299+
}
12981300
}
12991301

13001302
/*
@@ -1326,8 +1328,10 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
13261328
regs.flags &= ~PERF_EFLAGS_EXACT;
13271329
} else {
13281330
/* Workaround for erratum #1197 */
1329-
if (perf_ibs->fetch_ignore_if_zero_rip && !(ibs_data.regs[1]))
1331+
if (perf_ibs->fetch_ignore_if_zero_rip && !(ibs_data.regs[1])) {
1332+
throttle = perf_event_account_interrupt(event);
13301333
goto out;
1334+
}
13311335

13321336
set_linear_ip(&regs, ibs_data.regs[1]);
13331337
regs.flags |= PERF_EFLAGS_EXACT;

0 commit comments

Comments
 (0)