All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Christian Brauner <brauner@kernel.org>
Cc: linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jann Horn <jannh@google.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] perf: look up address filter files without ctx->mutex held
Date: Fri, 27 Nov 2026 09:13:03 +0100	[thread overview]
Message-ID: <20261127081303.GN49833@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261126-erlogen-bedrucken-dementieren-5de5e5460481@brauner>

On Thu, Nov 26, 2026 at 10:26:02PM +0100, Christian Brauner wrote:
> So ok, if we can't drop ctx->mutex in the middle of the ioctl then how
> about we don't hold ctx->mutex during parsing to begin with?
> We let perf_ioctl() hand PERF_EVENT_IOC_SET_FILTER off before it takes
> the mutex:
> 
> ioctl(PERF_EVENT_IOC_SET_FILTER)
> -> perf_ioctl()
>    -> perf_event_set_filter()                // no ctx->mutex
>       -> perf_event_set_addr_filter()
>          -> perf_event_parse_addr_filter()   // kern_path(), own list
>          -> perf_event_ctx_lock()
>             // revoked? has_addr_filter()? ->addr_filters_validate()
>             -> perf_addr_filters_splice()
>             -> perf_event_addr_filters_apply() on each child
>          -> perf_event_ctx_unlock()
> 
> The parser fills its own list and counts the file filters in locals.
> Everything that needs ctx->mutex then happens in one go under
> perf_event_ctx_lock().
> 
> So ctx->mutex is never dropped in the middle of an ioctl, a migrated
> event is handled by perf_event_ctx_lock() like everywhere else and no
> ctx is carried across the lookup?

Let me try this.

  parent reply	other threads:[~2026-11-27  8:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 11:45 [PATCH 0/2] exec: two more sleepers in the way of exec Christian Brauner
2026-11-26 11:45 ` [PATCH 1/2] perf: look up address filter files without ctx->mutex held Christian Brauner
2026-11-26 15:24   ` Peter Zijlstra
2026-11-26 20:56     ` Christian Brauner
2026-11-26 21:26       ` Christian Brauner
2026-11-26 21:59         ` Christian Brauner
2026-11-27  8:13         ` Peter Zijlstra [this message]
2026-11-27  9:18           ` Peter Zijlstra
2026-11-27  9:45             ` Christian Brauner
2026-11-27 11:57               ` Peter Zijlstra
2026-11-26 11:45 ` [PATCH 2/2] proc: call task_vsize() without exec_update_lock held Christian Brauner
2026-11-26 11:54 ` [PATCH 0/2] exec: two more sleepers in the way of exec sashiko-bot

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=20261127081303.GN49833@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=brauner@kernel.org \
    --cc=jannh@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stable@vger.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 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.