[tip: perf/core] perf/ring_buffer: Trigger IO signals for watermark_wakeup

From: tip-bot2 for Kyle Huey
Date: Sun Apr 14 2024 - 16:47:28 EST


The following commit has been merged into the perf/core branch of tip:

Commit-ID: fd20bb51ed3913e0d25085eb79e8c0babfb4ee28
Gitweb: https://git.kernel.org/tip/fd20bb51ed3913e0d25085eb79e8c0babfb4ee28
Author: Kyle Huey <me@xxxxxxxxxxxx>
AuthorDate: Sat, 13 Apr 2024 07:16:18 -07:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Sun, 14 Apr 2024 22:26:32 +02:00

perf/ring_buffer: Trigger IO signals for watermark_wakeup

perf_output_wakeup() already marks the perf event fd available for polling.
Trigger IO signals with FASYNC too.

Signed-off-by: Kyle Huey <khuey@xxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20240413141618.4160-3-khuey@xxxxxxxxxxxx
---
kernel/events/ring_buffer.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index 60ed43d..4013408 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -22,6 +22,10 @@ static void perf_output_wakeup(struct perf_output_handle *handle)
atomic_set(&handle->rb->poll, EPOLLIN);

handle->event->pending_wakeup = 1;
+
+ if (*perf_event_fasync(handle->event) && !handle->event->pending_kill)
+ handle->event->pending_kill = POLL_IN;
+
irq_work_queue(&handle->event->pending_irq);
}