Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4885377pxu; Wed, 21 Oct 2020 07:44:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBj9Y+s+QCoKhKmpjMggdHHxjqhRwzfHgXgR7+jDl/5wS54WjP6VukQ2Z0NoiFfkJ9EUo7 X-Received: by 2002:a05:6402:651:: with SMTP id u17mr3335331edx.206.1603291449445; Wed, 21 Oct 2020 07:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603291449; cv=none; d=google.com; s=arc-20160816; b=zXASab9sVkl/0xFEcqTlyjH8k4+C34+sQc/ZP+4XqE44gS0igO9qnEW4EXZqd9GYse eg+lqTR11NFAD1jlhToKC4KX5O2GdibLoVCRsgY7yY0mJXZccQKkebspWlrmEdrhbf5g X8quAolQGN+sSxfjH/CwNxW8SW1RKfWaKUvF3Ewy86EalCMuZ1xH4JV73ugcXF1sv1xm hsxMwVf7fehsTSWFdRlilO9pB24+qYA4vmUbJ4GMaw+Rugvl4GpVGxbvQFrRIBTmo9yN I29squtveue9W6OIkEe5UlPxoBjPZNF1302WWvL9PGg5/QKHz8SrOF7P2fXR/Bbf9voN M4AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=TGmDuRdg2v9oLxAMie/Bvsev2Etxzl+E+hv/cj7zHFI=; b=JoRuEc0tvKFx2/BUo3WsGc5A3zvzz50/Ef+ukEOCDlwHVOMa6fMRc89Dvr/rtKnhnL t0ET/dggbvXPX6Q4XnMpmxmW12ke1pwHD/L9mKT2TsRtgpw7rnIGweLBp2nfrSluBXiY 6VykMvIxn0aDdoK3JDdLoxh6MZcrShshXp2L5kj80ZmjNRVIoxC3VIiJep4n3yNcw0uq rnfgsYSCY9CoSTa2Kqm99cZqetmq5DUvGybKqEpbWuLHg2cN0S0ZhoMI9Re5fLZW3YDA wMD7TjZ1P9pHt8qMD2htpbSCHRorcde8bQSvEtHpr6MF151HbDrvyQaA9wMBou/PKXLa 8BCQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si1542890edn.457.2020.10.21.07.43.47; Wed, 21 Oct 2020 07:44:09 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2443306AbgJUOMU (ORCPT + 99 others); Wed, 21 Oct 2020 10:12:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:45588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2443301AbgJUOMU (ORCPT ); Wed, 21 Oct 2020 10:12:20 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D2EC22249; Wed, 21 Oct 2020 14:12:18 +0000 (UTC) Date: Wed, 21 Oct 2020 10:12:16 -0400 From: Steven Rostedt To: Zong Li Cc: paulmck@kernel.org, josh@joshtriplett.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, colin.king@canonical.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH] stop_machine: Mark functions as notrace Message-ID: <20201021101216.4d840e15@gandalf.local.home> In-Reply-To: <20201021073839.43935-1-zong.li@sifive.com> References: <20201021073839.43935-1-zong.li@sifive.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Oct 2020 15:38:39 +0800 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()") I really do not like to add "notrace" to core functions because a single architecture has issues with it. Why does RISCV have problems with these functions but no other architecture does? NACK from me until it is shown that these are issues for a broader set of architectures. It sounds to me like you are treating a symptom and not the disease. -- Steve > > 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(); > }