Skip to content

Commit 86baa54

Browse files
committed
Merge tag 'perf-urgent-2025-04-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull misc perf events fixes from Ingo Molnar: - Use POLLERR for events in error state, instead of the ambiguous POLLHUP error value - Fix non-sampling (counting) events on certain x86 platforms * tag 'perf-urgent-2025-04-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86: Fix non-sampling (counting) events on certain x86 platforms perf/core: Change to POLLERR for pinned events with error
2 parents a226e65 + 1a97fea commit 86baa54

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/x86/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ int x86_pmu_hw_config(struct perf_event *event)
629629
if (event->attr.type == event->pmu->type)
630630
event->hw.config |= x86_pmu_get_event_config(event);
631631

632-
if (!event->attr.freq && x86_pmu.limit_period) {
632+
if (is_sampling_event(event) && !event->attr.freq && x86_pmu.limit_period) {
633633
s64 left = event->attr.sample_period;
634634
x86_pmu.limit_period(event, &left);
635635
if (left > event->attr.sample_period)

kernel/events/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3943,7 +3943,7 @@ static int merge_sched_in(struct perf_event *event, void *data)
39433943
perf_event_set_state(event, PERF_EVENT_STATE_ERROR);
39443944

39453945
if (*perf_event_fasync(event))
3946-
event->pending_kill = POLL_HUP;
3946+
event->pending_kill = POLL_ERR;
39473947

39483948
perf_event_wakeup(event);
39493949
} else {
@@ -6075,7 +6075,7 @@ static __poll_t perf_poll(struct file *file, poll_table *wait)
60756075

60766076
if (unlikely(READ_ONCE(event->state) == PERF_EVENT_STATE_ERROR &&
60776077
event->attr.pinned))
6078-
return events;
6078+
return EPOLLERR;
60796079

60806080
/*
60816081
* Pin the event->rb by taking event->mmap_mutex; otherwise

0 commit comments

Comments
 (0)