Skip to content

Commit 0db6138

Browse files
namhyungIngo Molnar
authored andcommitted
perf/core: Change to POLLERR for pinned events with error
Commit: f4b07fd ("perf/core: Use POLLHUP for pinned events in error") started to emit POLLHUP for pinned events in an error state. But the POLLHUP is also used to signal events that the attached task is terminated. To distinguish pinned per-task events in the error state it would need to check if the task is live. Change it to POLLERR to make it clear. Suggested-by: Gabriel Marin <gmx@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20250422223318.180343-1-namhyung@kernel.org
1 parent bc33723 commit 0db6138

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)