From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v8] perf record: Fix unhandled POLLHUP on non_perf_event descriptors
Date: Wed, 16 Sep 2026 09:12:54 -0300 [thread overview]
Message-ID: <aqqHxvhiGxQjjRDS@x2> (raw)
In-Reply-To: <CAP-5=fUFYbvxEnEBJt5g1TFHxxTKkgVqLuTEnXUKWQ1qACGFNg@mail.gmail.com>
On Tue, Sep 15, 2026 at 01:22:24PM -0700, Ian Rogers wrote:
> On Thu, Aug 20, 2026 at 3:00 PM Ian Rogers <irogers@google.com> wrote:
> >
> > On Thu, Aug 20, 2026 at 2:47 PM <sashiko-bot@kernel.org> wrote:
> > >
> > > > When processing POLLHUP on a non_perf_event control descriptor,
> > > > evlist__finalize_ctlfd() is invoked to finalize the setup, correctly
> > > > setting the core evlist's poll array file descriptor to -1. However,
> > > > this finalized teardown state is never propagated back to the
> > > > individual thread's local replica of the pollfd array.
> > > >
> > > > Consequently, on the next iteration of the main recording loop,
> > > > record__update_evlist_pollfd_from_thread() performs a strict
> > > > equivalence check between the core evlist's array and the thread's
> > > > localized poll array, detecting that the fd values no longer match.
> > > > This causes an immediate -EINVAL abort and a premature teardown.
> > > >
> > > > Fix the underlying logic within
> > > > record__update_evlist_pollfd_from_thread() to sustainably propagate
> > > > the finalized teardown statuses (-1) originating from the core evlist
> > > > back to the thread's localized poll structure. This correctly
> > > > maintains synchronization and entirely prevents the unhandled
> > > > index mismatch crashes.
> > > >
> > > > Additionally, add a unit test that explicitly validates that
> > > > fdarray__filter() preserves its invariants regarding
> > > > fdarray_flag__nonfilterable items to guard against regressions.
> > > >
> > > > Fixes: fb4751e79c45 ("perf record: Fix teardown hang on system-wide multi-threaded sessions")
> > > > Assisted-by: Gemini:gemini-3.1-pro
> > > > Signed-off-by: Ian Rogers <irogers@google.com>
> > >
> > > Sashiko has reviewed this patch and found no issues. It looks great!
>
> Ping. Thanks,
> Ian
Thanks, applied to perf-tools-next, for v7.4.
- Arnaldo
prev parent reply other threads:[~2026-09-16 12:12 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 5:39 [PATCH v1 1/2] perf record: Fix teardown hang on system-wide multi-threaded sessions Ian Rogers
2026-07-10 5:39 ` [PATCH v1 2/2] perf cap: If capability is missing still perform root test Ian Rogers
2026-07-10 5:47 ` sashiko-bot
2026-07-10 22:24 ` Namhyung Kim
2026-07-16 7:40 ` [PATCH v2] perf cap: Remove used_root parameter and simplify capability checks Ian Rogers
2026-07-23 5:06 ` [PATCH v3] " Ian Rogers
2026-07-24 5:47 ` Namhyung Kim
2026-07-10 5:56 ` [PATCH v1 1/2] perf record: Fix teardown hang on system-wide multi-threaded sessions sashiko-bot
2026-07-10 22:02 ` Namhyung Kim
2026-07-12 6:56 ` (subset) " Namhyung Kim
2026-07-16 7:37 ` [PATCH v2] perf record: Fix destructor invocation and event counting in fdarray__filter Ian Rogers
2026-07-16 8:00 ` sashiko-bot
2026-07-23 5:04 ` [PATCH v3] " Ian Rogers
2026-07-23 5:27 ` sashiko-bot
2026-08-17 23:04 ` [PATCH v4] perf fdarray: " Ian Rogers
2026-08-17 23:17 ` Namhyung Kim
2026-08-17 23:30 ` Ian Rogers
2026-08-17 23:28 ` sashiko-bot
2026-08-18 0:31 ` [PATCH v5] perf record: Fix unhandled POLLHUP on non_perf_event descriptors Ian Rogers
2026-08-18 0:43 ` sashiko-bot
2026-08-20 16:49 ` [PATCH v6] " Ian Rogers
2026-08-20 17:00 ` sashiko-bot
2026-08-20 20:02 ` [PATCH v7] " Ian Rogers
2026-08-20 20:17 ` sashiko-bot
2026-08-20 21:37 ` [PATCH v8] " Ian Rogers
2026-08-20 21:47 ` sashiko-bot
2026-08-20 22:00 ` Ian Rogers
2026-09-15 20:22 ` Ian Rogers
2026-09-16 12:12 ` Arnaldo Carvalho de Melo [this message]
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=aqqHxvhiGxQjjRDS@x2 \
--to=acme@kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
/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