mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: kan.liang@linux.intel.com
Cc: mingo@redhat.com, acme@kernel.org, namhyung@kernel.org,
	irogers@google.com, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org, linux-s390@vger.kernel.org,
	Sumanth Korikkar <sumanthk@linux.ibm.com>
Subject: Re: [PATCH] perf: Fix the POLL_HUP delivery breakage
Date: Wed, 3 Sep 2025 10:12:11 +0200	[thread overview]
Message-ID: <20250903081211.GO3245006@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250811182644.1305952-1-kan.liang@linux.intel.com>

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?

  parent reply	other threads:[~2025-09-03  8:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 18:26 kan.liang
2025-09-03  7:53 ` Sumanth Korikkar
2025-09-03  8:12 ` Peter Zijlstra [this message]
2025-09-03  8:16 ` [tip: perf/urgent] " tip-bot2 for Kan Liang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250903081211.GO3245006@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=sumanthk@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®