From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1] perf test task-exit: Fix POLLHUP busy-loop race waiting for SIGCHLD
Date: Sun, 25 Oct 2026 22:08:27 +0000 [thread overview]
Message-ID: <sashiko-outbox-184461@kernel.org> (raw)
In-Reply-To: <20261025214928.1225895-1-irogers@google.com>
> In the kernel's do_exit(), perf_event_exit_task() runs before exit_mm()
> and exit_notify() (which delivers SIGCHLD to the parent). Once
> perf_event_exit_task() completes, PERF_RECORD_EXIT is written to the
> ring buffer and POLLHUP is set on the perf event file descriptor.
>
> In test__task_exit(), once POLLHUP is set on the fd, evlist__poll()
> returns immediately on every call without blocking. If the child is
> still in exit_mm()..exit_notify() on another CPU when the parent reads
> PERF_RECORD_EXIT, exited is still 0 and the retry loop spins through all
> 1000 non-blocking poll() calls in less than a millisecond before SIGCHLD
> is delivered.
>
> Sleep briefly with usleep(1000) on subsequent retries (which also wakes
> early on EINTR when SIGCHLD arrives), mark exited as volatile
> sig_atomic_t, and reset exited and nr_exit on test entry.
>
> Fixes: 791ce9c48c79 ("perf test: Avoid infinite loop for task exit case")
> Signed-off-by: Ian Rogers <irogers@google.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261025214928.1225895-1-irogers@google.com?part=1
prev parent reply other threads:[~2026-10-25 22:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 21:49 [PATCH v1] perf test task-exit: Fix POLLHUP busy-loop race waiting for SIGCHLD Ian Rogers
2026-10-25 22:08 ` sashiko-bot [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=sashiko-outbox-184461@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.