Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniel Wade" <danjwade95@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf/core: Don't take owner->perf_event_mutex under ctx->mutex on exec
Date: Sun, 15 Nov 2026 23:55:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-215931@kernel.org> (raw)
In-Reply-To: <20261115233949.13685-1-danjwade95@gmail.com>

> perf_event_remove_on_exec() holds the exec'ing task's ctx->mutex and calls
> perf_remove_from_owner(), which takes the owner's perf_event_mutex. The
> order documented above perf_event_ctx_lock_nested() is the reverse:
> 
>     exec_update_lock
>       task_struct::perf_event_mutex
>         perf_event_context::mutex
> 
> perf_event_task_enable() and perf_event_task_disable() follow it, holding
> current->perf_event_mutex while they lock the context of each event the
> task owns. The two paths deadlock against each other:
> 
>   perf_event_task_disable()            perf_event_remove_on_exec()
>     mutex_lock(perf_event_mutex)         mutex_lock(ctx->mutex)
>     perf_event_ctx_lock()                perf_remove_from_owner()
> [ ... ]
> 
> Fixes: 2e498d0a74e5 ("perf: Add support for event removal on exec")
> Reported-by: Ian Rogers <irogers@google.com>
> Closes: https://lore.kernel.org/all/CAP-5=fVq=2D6XjVEbAvJz54hG6PcwZZjn-za0hAfK8YV-J+MtQ@mail.gmail.com/
> Signed-off-by: Daniel Wade <danjwade95@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115233949.13685-1-danjwade95@gmail.com?part=1


      reply	other threads:[~2026-11-15 23:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 23:39 [PATCH] perf/core: Don't take owner->perf_event_mutex under ctx->mutex on exec Daniel Wade
2026-11-15 23:55 ` 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-215931@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=danjwade95@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox