mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Francesco Nigro <nigro.fra@gmail.com>,
	peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, adrian.hunter@intel.com,
	james.clark@linaro.org, kan.liang@linux.intel.com,
	leo.yan@arm.com, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org, regressions@lists.linux.dev
Subject: Re: [PATCH v2] perf test: Add test for events re-armed with PERF_EVENT_IOC_REFRESH
Date: Wed, 21 Oct 2026 18:58:59 -0300	[thread overview]
Message-ID: <atk1o-g0alZNiKf_@x2> (raw)
In-Reply-To: <CAP-5=fVB1LWLfvXm97TpjjKL6037mHZW0GzuR94wSaOOoGR8_w@mail.gmail.com>

On Wed, Oct 21, 2026 at 10:33:42AM -0700, Ian Rogers wrote:
> On Wed, Oct 21, 2026 at 7:17 AM Francesco Nigro <nigro.fra@gmail.com> wrote:
> >
> > Open a sampling event with sample_period 1, re-arm it with
> > PERF_EVENT_IOC_REFRESH from its overflow signal handler, as
> > self-profilers such as async-profiler do, and check that each of 1000
> > events delivers a signal. One case uses a software event (page faults),
> > the other the syscalls:sys_enter_getppid tracepoint. The signal is a
> > real-time one, so overflows cannot be coalesced, and the page fault
> > buffer is marked MADV_NOHUGEPAGE so that each touched page faults once.
> >
> > The tracepoint case fails since
> > commit 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage"):
> > only the first overflow is delivered. The re-arming ioctl succeeds,
> > but the event count stays at 1. It passes on the parent commit. The
> > software case passes on both.
> >
> > The test was written with an AI coding assistant (Claude) from a
> > standalone reproducer; I reviewed it and ran it in QEMU on current
> > mainline, on that commit and on its parent.
> >
> > Link: https://github.com/async-profiler/async-profiler/issues/1813
> > Signed-off-by: Francesco Nigro <nigro.fra@gmail.com>
> 
> Thanks Francesco, testing locally I see a failure on  7.1.6:
> ```
> $ sudo /tmp/perf/perf test -v IOC_REFRESH
> Not taking turns using the perf mlock budget: nothing can exhaust it
> 20: Event re-armed with PERF_EVENT_IOC_REFRESH                        :
> 20.1: Software event                                                  : Ok
> ---- start ----
> test child forked, pid 187381
> 1000 events, count 1, 1 overflows (1 POLL_HUP), re-arm errno 0
> ---- end(-1) ----
> 20.2: Tracepoint event                                                : FAILED!
> 
> === Test Summary ===
> Passed main tests : 0
> Passed subtests   : 1
> Skipped tests     : 0
> Failed tests      : 1
> List of failed tests:
>   20.2: Tracepoint event
> ```
> I believe this is currently expected until the kernel is fixed, which
> is somewhat unfortunate. The code looks okay and the build isn't
> regressed.
> 
> Reviewed-by: Ian Rogers <irogers@google.com>

Thanks Francesco for writing the test!

Applied to perf-tools-next, for v7.4.

- Arnaldo

      reply	other threads:[~2026-10-21 21:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 14:17 Francesco Nigro
2026-10-21 17:33 ` Ian Rogers
2026-10-21 21:58   ` 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=atk1o-g0alZNiKf_@x2 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nigro.fra@gmail.com \
    --cc=peterz@infradead.org \
    --cc=regressions@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 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®