From: Colin Ian King <colin.king@canonical.com>
To: Zong Li <zong.li@sifive.com>,
paulmck@kernel.org, josh@joshtriplett.org, rostedt@goodmis.org,
mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
joel@joelfernandes.org, vincent.whitchurch@axis.com,
tglx@linutronix.de, paul.walmsley@sifive.com,
palmerdabbelt@google.com, guoren@kernel.org,
atishp@atishpatra.org, mhiramat@kernel.org,
greentime.hu@sifive.com, rcu@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] stop_machine: Mark functions as notrace
Date: Fri, 23 Oct 2020 20:29:24 +0100 [thread overview]
Message-ID: <50bdca78-0cbb-5c62-f241-ed50737131b2@canonical.com> (raw)
In-Reply-To: <20201021073839.43935-1-zong.li@sifive.com>
On 21/10/2020 08:38, Zong Li wrote:
> Like the commit cb9d7fd51d9f ("watchdog: Mark watchdog touch functions
> as notrace"), some architectures assume that the stopped CPUs don't make
> function calls to traceable functions when they are in the stopped
> state. For example, it causes unexpected kernel crashed when switching
> tracer on RISC-V.
>
> The following patches added calls to these two functions, fix it by
> adding the notrace annotations.
>
> Fixes: 4ecf0a43e729 ("processor: get rid of cpu_relax_yield")
> Fixes: 366237e7b083 ("stop_machine: Provide RCU quiescent state in
> multi_cpu_stop()")
>
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
> kernel/rcu/tree.c | 2 +-
> kernel/stop_machine.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 06895ef85d69..2a52f42f64b6 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -409,7 +409,7 @@ bool rcu_eqs_special_set(int cpu)
> *
> * The caller must have disabled interrupts and must not be idle.
> */
> -void rcu_momentary_dyntick_idle(void)
> +notrace void rcu_momentary_dyntick_idle(void)
> {
> int special;
>
> diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
> index 865bb0228ab6..890b79cf0e7c 100644
> --- a/kernel/stop_machine.c
> +++ b/kernel/stop_machine.c
> @@ -178,7 +178,7 @@ static void ack_state(struct multi_stop_data *msdata)
> set_state(msdata, msdata->state + 1);
> }
>
> -void __weak stop_machine_yield(const struct cpumask *cpumask)
> +notrace void __weak stop_machine_yield(const struct cpumask *cpumask)
> {
> cpu_relax();
> }
>
Apologies for taking so long to reply, I needed to test this on several
devices.
This not only fixes the ftrace issue I see on RISC-V but also a ftrace
hang issue on ARM64 in 5.8 too.
Tested-by: Colin Ian King <colin.king@canonical.com>
Many thanks!
next prev parent reply other threads:[~2020-10-23 19:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 7:38 Zong Li
2020-10-21 14:12 ` Steven Rostedt
2020-10-21 14:15 ` Steven Rostedt
2020-10-21 15:44 ` Paul E. McKenney
2020-10-21 15:54 ` Steven Rostedt
2020-10-21 16:16 ` Paul E. McKenney
2020-10-22 0:58 ` Atish Patra
2020-10-23 19:29 ` Colin Ian King [this message]
2020-10-26 2:56 ` Zong Li
2020-10-26 11:17 ` [tip: smp/urgent] stop_machine, rcu: " tip-bot2 for Zong Li
2020-10-28 15:44 ` [PATCH] stop_machine: " Guo Ren
2020-10-29 0:23 ` Atish Patra
2020-10-29 2:34 ` Zong Li
2020-10-29 16:06 ` Guo Ren
2020-10-29 18:46 ` Atish Patra
2020-10-30 3:28 ` Guo Ren
2020-10-30 21:47 ` Atish Patra
2020-10-31 0:28 ` Steven Rostedt
2020-10-31 7:42 ` Guo Ren
2020-11-03 15:33 ` Atish Patra
2020-11-06 2:44 ` Guo Ren
2020-10-29 16:01 ` Guo Ren
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=50bdca78-0cbb-5c62-f241-ed50737131b2@canonical.com \
--to=colin.king@canonical.com \
--cc=atishp@atishpatra.org \
--cc=greentime.hu@sifive.com \
--cc=guoren@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=palmerdabbelt@google.com \
--cc=paul.walmsley@sifive.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vincent.whitchurch@axis.com \
--cc=zong.li@sifive.com \
/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®