All of lore.kernel.org
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@dabbelt.com>
To: changbin.du@gmail.com
Cc: rostedt@goodmis.org, changbin.du@gmail.com,
	Paul Walmsley <paul.walmsley@sifive.com>,
	mingo@redhat.com, aou@eecs.berkeley.edu,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: ftrace: no need to acquire text_mutex when executed in stop_machine
Date: Mon, 21 Mar 2022 19:40:08 -0700 (PDT)	[thread overview]
Message-ID: <mhng-62c2ef00-fb64-48c3-a2bb-43b2799161bf@palmer-ri-x1c9> (raw)
In-Reply-To: <20220313080711.mrzsgtxpbycug2vm@mail.google.com>

On Sun, 13 Mar 2022 00:07:11 PST (-0800), changbin.du@gmail.com wrote:
> On Thu, Mar 10, 2022 at 09:27:42AM -0500, Steven Rostedt wrote:
>> On Thu, 10 Mar 2022 12:54:54 +0800
>> Changbin Du <changbin.du@gmail.com> wrote:
>>
>> > It's safe to patch text segment in stop_machine. No race is possible here.
>> > Besides, there is a false positive for the lock assertion in
>> > patch_insn_write() since the lock is not held by cpu migration thread.
>> >
>> > So we actually don't need our ftrace_arch_code_modify_prepare/post(). And
>> > the lock assertion in patch_insn_write() should be removed to avoid
>> > producing lots of false positive warnings.
>> >
>> > Signed-off-by: Changbin Du <changbin.du@gmail.com>
>>
>> Ideally, RISC-V should try to get off of the stop_machine approach, and
>> move to the breakpoint modification.
>>
> yes, that's a further step. I can feel a obvious stall to enable ftrace running
> in QEMU. (maybe qemu-riscv tcg is too slow...)

Looks like we've had this exact discussion before, even with exactly the 
same patch and people and everything.  I guess I dropped the ball here, 
I got so distracted trying to figure out those sequences to avoid 
stop_machine() that I forgot to clean up the patch to fix stop machine.  
I just sent out a v2 <20220322022331.32136-1-palmer@rivosinc.com>.  That 
should at least fix the crash, we can deal with getting rid of 
stop_machine() later.

WARNING: multiple messages have this Message-ID (diff)
From: Palmer Dabbelt <palmer@dabbelt.com>
To: changbin.du@gmail.com
Cc: rostedt@goodmis.org, changbin.du@gmail.com,
	Paul Walmsley <paul.walmsley@sifive.com>,
	mingo@redhat.com, aou@eecs.berkeley.edu,
	linux-riscv@lists.infradead.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: ftrace: no need to acquire text_mutex when executed in stop_machine
Date: Mon, 21 Mar 2022 19:40:08 -0700 (PDT)	[thread overview]
Message-ID: <mhng-62c2ef00-fb64-48c3-a2bb-43b2799161bf@palmer-ri-x1c9> (raw)
In-Reply-To: <20220313080711.mrzsgtxpbycug2vm@mail.google.com>

On Sun, 13 Mar 2022 00:07:11 PST (-0800), changbin.du@gmail.com wrote:
> On Thu, Mar 10, 2022 at 09:27:42AM -0500, Steven Rostedt wrote:
>> On Thu, 10 Mar 2022 12:54:54 +0800
>> Changbin Du <changbin.du@gmail.com> wrote:
>>
>> > It's safe to patch text segment in stop_machine. No race is possible here.
>> > Besides, there is a false positive for the lock assertion in
>> > patch_insn_write() since the lock is not held by cpu migration thread.
>> >
>> > So we actually don't need our ftrace_arch_code_modify_prepare/post(). And
>> > the lock assertion in patch_insn_write() should be removed to avoid
>> > producing lots of false positive warnings.
>> >
>> > Signed-off-by: Changbin Du <changbin.du@gmail.com>
>>
>> Ideally, RISC-V should try to get off of the stop_machine approach, and
>> move to the breakpoint modification.
>>
> yes, that's a further step. I can feel a obvious stall to enable ftrace running
> in QEMU. (maybe qemu-riscv tcg is too slow...)

Looks like we've had this exact discussion before, even with exactly the 
same patch and people and everything.  I guess I dropped the ball here, 
I got so distracted trying to figure out those sequences to avoid 
stop_machine() that I forgot to clean up the patch to fix stop machine.  
I just sent out a v2 <20220322022331.32136-1-palmer@rivosinc.com>.  That 
should at least fix the crash, we can deal with getting rid of 
stop_machine() later.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2022-03-22  2:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10  4:54 [PATCH] riscv: ftrace: no need to acquire text_mutex when executed in stop_machine Changbin Du
2022-03-10  4:54 ` Changbin Du
2022-03-10 14:27 ` Steven Rostedt
2022-03-10 14:27   ` Steven Rostedt
2022-03-13  8:07   ` Changbin Du
2022-03-13  8:07     ` Changbin Du
2022-03-22  2:40     ` Palmer Dabbelt [this message]
2022-03-22  2:40       ` Palmer Dabbelt

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=mhng-62c2ef00-fb64-48c3-a2bb-43b2799161bf@palmer-ri-x1c9 \
    --to=palmer@dabbelt.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=changbin.du@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mingo@redhat.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rostedt@goodmis.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.