* [PATCH] perf: Fix the POLL_HUP delivery breakage
@ 2025-08-11 18:26 kan.liang
2025-09-03 7:53 ` Sumanth Korikkar
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: kan.liang @ 2025-08-11 18:26 UTC (permalink / raw)
To: peterz, mingo, acme, namhyung, irogers, linux-kernel,
linux-perf-users, linux-s390
Cc: Kan Liang, Sumanth Korikkar
From: Kan Liang <kan.liang@linux.intel.com>
The event_limit can be set by the PERF_EVENT_IOC_REFRESH to limit the
number of events. When the event_limit reaches 0, the POLL_HUP signal
should be sent. But it's missed.
The corresponding counter should be stopped when the event_limit reaches
0. It was implemented in the ARCH-specific code. However, since the
commit 9734e25fbf5a ("perf: Fix the throttle logic for a group"), all
the ARCH-specific code has been moved to the generic code. The code to
handle the event_limit was lost.
Add the event->pmu->stop(event, 0); back.
Fixes: 9734e25fbf5a ("perf: Fix the throttle logic for a group")
Closes: https://lore.kernel.org/lkml/aICYAqM5EQUlTqtX@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com/
Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index dd8cf3c7fb7a..ec19c456b66d 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10378,6 +10378,7 @@ static int __perf_event_overflow(struct perf_event *event,
ret = 1;
event->pending_kill = POLL_HUP;
perf_event_disable_inatomic(event);
+ event->pmu->stop(event, 0);
}
if (event->attr.sigtrap) {
--
2.38.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf: Fix the POLL_HUP delivery breakage
2025-08-11 18:26 [PATCH] perf: Fix the POLL_HUP delivery breakage kan.liang
@ 2025-09-03 7:53 ` Sumanth Korikkar
2025-09-03 8:12 ` Peter Zijlstra
2025-09-03 8:16 ` [tip: perf/urgent] " tip-bot2 for Kan Liang
2 siblings, 0 replies; 4+ messages in thread
From: Sumanth Korikkar @ 2025-09-03 7:53 UTC (permalink / raw)
To: kan.liang
Cc: peterz, mingo, acme, namhyung, irogers, linux-kernel,
linux-perf-users, linux-s390
On Mon, Aug 11, 2025 at 11:26:44AM -0700, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> The event_limit can be set by the PERF_EVENT_IOC_REFRESH to limit the
> number of events. When the event_limit reaches 0, the POLL_HUP signal
> should be sent. But it's missed.
>
> The corresponding counter should be stopped when the event_limit reaches
> 0. It was implemented in the ARCH-specific code. However, since the
> commit 9734e25fbf5a ("perf: Fix the throttle logic for a group"), all
> the ARCH-specific code has been moved to the generic code. The code to
> handle the event_limit was lost.
>
> Add the event->pmu->stop(event, 0); back.
>
> Fixes: 9734e25fbf5a ("perf: Fix the throttle logic for a group")
> Closes: https://lore.kernel.org/lkml/aICYAqM5EQUlTqtX@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com/
> Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> ---
> kernel/events/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index dd8cf3c7fb7a..ec19c456b66d 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -10378,6 +10378,7 @@ static int __perf_event_overflow(struct perf_event *event,
> ret = 1;
> event->pending_kill = POLL_HUP;
> perf_event_disable_inatomic(event);
> + event->pmu->stop(event, 0);
> }
>
> if (event->attr.sigtrap) {
> --
> 2.38.1
>
Hi All,
It would be great, if this patch can be integrated soon.
Thank you
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf: Fix the POLL_HUP delivery breakage
2025-08-11 18:26 [PATCH] perf: Fix the POLL_HUP delivery breakage kan.liang
2025-09-03 7:53 ` Sumanth Korikkar
@ 2025-09-03 8:12 ` Peter Zijlstra
2025-09-03 8:16 ` [tip: perf/urgent] " tip-bot2 for Kan Liang
2 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2025-09-03 8:12 UTC (permalink / raw)
To: kan.liang
Cc: mingo, acme, namhyung, irogers, linux-kernel, linux-perf-users,
linux-s390, Sumanth Korikkar
On Mon, Aug 11, 2025 at 11:26:44AM -0700, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> The event_limit can be set by the PERF_EVENT_IOC_REFRESH to limit the
> number of events. When the event_limit reaches 0, the POLL_HUP signal
> should be sent. But it's missed.
>
> The corresponding counter should be stopped when the event_limit reaches
> 0. It was implemented in the ARCH-specific code. However, since the
> commit 9734e25fbf5a ("perf: Fix the throttle logic for a group"), all
> the ARCH-specific code has been moved to the generic code. The code to
> handle the event_limit was lost.
>
> Add the event->pmu->stop(event, 0); back.
>
> Fixes: 9734e25fbf5a ("perf: Fix the throttle logic for a group")
> Closes: https://lore.kernel.org/lkml/aICYAqM5EQUlTqtX@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com/
> Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> ---
> kernel/events/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index dd8cf3c7fb7a..ec19c456b66d 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -10378,6 +10378,7 @@ static int __perf_event_overflow(struct perf_event *event,
> ret = 1;
> event->pending_kill = POLL_HUP;
> perf_event_disable_inatomic(event);
> + event->pmu->stop(event, 0);
> }
>
> if (event->attr.sigtrap) {
Right. I've queued the patch, but should we take a hard look at anybody
still consuming the return value of perf_event_overflow?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip: perf/urgent] perf: Fix the POLL_HUP delivery breakage
2025-08-11 18:26 [PATCH] perf: Fix the POLL_HUP delivery breakage kan.liang
2025-09-03 7:53 ` Sumanth Korikkar
2025-09-03 8:12 ` Peter Zijlstra
@ 2025-09-03 8:16 ` tip-bot2 for Kan Liang
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Kan Liang @ 2025-09-03 8:16 UTC (permalink / raw)
To: linux-tip-commits
Cc: Sumanth Korikkar, Kan Liang, Peter Zijlstra (Intel), x86, linux-kernel
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 18dbcbfabfffc4a5d3ea10290c5ad27f22b0d240
Gitweb: https://git.kernel.org/tip/18dbcbfabfffc4a5d3ea10290c5ad27f22b0d240
Author: Kan Liang <kan.liang@linux.intel.com>
AuthorDate: Mon, 11 Aug 2025 11:26:44 -07:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 03 Sep 2025 10:10:59 +02:00
perf: Fix the POLL_HUP delivery breakage
The event_limit can be set by the PERF_EVENT_IOC_REFRESH to limit the
number of events. When the event_limit reaches 0, the POLL_HUP signal
should be sent. But it's missed.
The corresponding counter should be stopped when the event_limit reaches
0. It was implemented in the ARCH-specific code. However, since the
commit 9734e25fbf5a ("perf: Fix the throttle logic for a group"), all
the ARCH-specific code has been moved to the generic code. The code to
handle the event_limit was lost.
Add the event->pmu->stop(event, 0); back.
Fixes: 9734e25fbf5a ("perf: Fix the throttle logic for a group")
Closes: https://lore.kernel.org/lkml/aICYAqM5EQUlTqtX@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com/
Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Link: https://lkml.kernel.org/r/20250811182644.1305952-1-kan.liang@linux.intel.com
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 872122e..8201275 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10330,6 +10330,7 @@ static int __perf_event_overflow(struct perf_event *event,
ret = 1;
event->pending_kill = POLL_HUP;
perf_event_disable_inatomic(event);
+ event->pmu->stop(event, 0);
}
if (event->attr.sigtrap) {
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-03 8:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-11 18:26 [PATCH] perf: Fix the POLL_HUP delivery breakage kan.liang
2025-09-03 7:53 ` Sumanth Korikkar
2025-09-03 8:12 ` Peter Zijlstra
2025-09-03 8:16 ` [tip: perf/urgent] " tip-bot2 for Kan Liang
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®