mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: alexghiti@rivosinc.com, mhiramat@kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	aou@eecs.berkeley.edu, Alexandre Ghiti <alex@ghiti.fr>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, rabenda.cn@gmail.com,
	wangruikang@iscas.ac.cn, ziyao@disroot.org
Subject: Re: [PATCH] riscv: ftrace: Properly acquire text_mutex to fix a race condition
Date: Wed, 9 Jul 2025 12:45:36 -0400	[thread overview]
Message-ID: <20250709124536.4ce3a90b@batman.local.home> (raw)
In-Reply-To: <mhng-6AFAE150-B97C-493D-9699-545AABAC78FD@palmerdabbelt-mac>

On Wed, 09 Jul 2025 07:12:47 -0700 (PDT)
Palmer Dabbelt <palmer@dabbelt.com> wrote:

> >  #ifdef CONFIG_DYNAMIC_FTRACE
> > +void ftrace_arch_code_modify_prepare(void)
> > +{
> > +	mutex_lock(&text_mutex);
> > +}
> > +
> > +void ftrace_arch_code_modify_post_process(void)
> > +{
> > +	mutex_unlock(&text_mutex);
> > +}  
> 
> IIRC there's a reason we don't do it this way, we had (or had tried to) 
> have it before.  It's been a while, though, and I'm just having some a 
> coffee so may I'm just wrong...

Yes, because it caused issues with stop machine[1], but if you are no
longer using stop machine, this should be what you should do now.

[1] https://lore.kernel.org/all/20220310045454.672097-1-changbin.du@gmail.com/

-- Steve

  reply	other threads:[~2025-07-09 16:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08  8:33 Alexandre Ghiti
2025-07-09 14:12 ` Palmer Dabbelt
2025-07-09 16:45   ` Steven Rostedt [this message]
2025-07-16 15:22     ` Palmer Dabbelt
2025-07-10  0:06 ` Masami Hiramatsu
2025-07-10  6:21 ` Han Gao
2025-07-11 10:00 ` Andy Chiu

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=20250709124536.4ce3a90b@batman.local.home \
    --to=rostedt@goodmis.org \
    --cc=alex@ghiti.fr \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rabenda.cn@gmail.com \
    --cc=wangruikang@iscas.ac.cn \
    --cc=ziyao@disroot.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

all inboxes | Powered by JetHome®