Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp759287pxu; Fri, 23 Oct 2020 12:31:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEdR+6NxhoNUHlMEEAATgu9p6XWOv1GXy2pDmoGP4o26YGH4HkvLlLDFC1NPtuqFA45FYy X-Received: by 2002:a17:906:348c:: with SMTP id g12mr3707202ejb.422.1603481466093; Fri, 23 Oct 2020 12:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603481466; cv=none; d=google.com; s=arc-20160816; b=Vo04pi21wtVxzN7po6PutGbnDhIV1bZ13oiaFYX01hQFQQiA2mtXF0zKd66mxdx7f/ k3j2LiTEedhJ3IvMRAZh8tyHAzuUBIHqtdXQZGrmvHHvEf/TdkDogcmdDwCyv3rQwNTm vinuazIUZ6xCE/El8Rme4N8iXv0gW1UyJRd60m4rIwz9KtRYq/JY5fqdqbTRJLRaajb5 1CcZBm00ZnvF1OB/6cvxkZn0+7GFDSP76mKavXHjZ2b7e/J7hQPPUamq5osAIIJr5aSR b4RinQbKn6DuwNyfQk4qZLvpwM7CeYUOm6r8bSF8yNB0idTIDF6n3WRM6N1g7SC7kqNh oVJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=NIIQlfZavne+6nvkbC4UzRyDeiH5K5QYxtnbDPci8lk=; b=NtFfswfuYGIZFJvReflp2mzYEKKU3aZvJhxqM+YNZomCvpWv5GUGARknyMeMlG7Y6H XMYRcdmQsukyBWjriyNNH3NOKtPCmPT3NLzDQ68y1eVlzaDGqBPOLICdoaCdOk7vRK4N n7fl8lkcjmEgPo/pkJvCV+ka36ZRjKkWpDHAkX6ZLDikzhcyIfjoC36oRYQcuz61eb0m lXN3ICFJxmtDg3z78etg9K/ulXzhb4IS241P3QaVSgz8O4+AlJr3+E3+DfIbJv9uSuiV mARHPaVrpru747JhbmN8K10w7+pZRQaTUdRM3u6yOvGT06OWyuWtNKVRXez/nPizaiF+ hfvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q27si1512000eji.605.2020.10.23.12.30.42; Fri, 23 Oct 2020 12:31:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754052AbgJWT3c (ORCPT + 99 others); Fri, 23 Oct 2020 15:29:32 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:45809 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753115AbgJWT3b (ORCPT ); Fri, 23 Oct 2020 15:29:31 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kW2kg-0005Ad-2w; Fri, 23 Oct 2020 19:29:26 +0000 Subject: Re: [PATCH] stop_machine: Mark functions as notrace To: Zong Li , 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 References: <20201021073839.43935-1-zong.li@sifive.com> From: Colin Ian King Message-ID: <50bdca78-0cbb-5c62-f241-ed50737131b2@canonical.com> Date: Fri, 23 Oct 2020 20:29:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20201021073839.43935-1-zong.li@sifive.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 Many thanks!