Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp99057rbe; Wed, 28 Feb 2024 13:31:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWmRYCGJglA9qrcvgNhgIrDNVjIj+GBf7myJ8kLQtJRbAgDxdrA9iJbW5sGVZncQyNJd9KtCUYRX0pX1Ss459KlTA/XAE3QgLlKQxVACw== X-Google-Smtp-Source: AGHT+IGaXkBKUdi07K4KnFqj+x5J0URFFE0IUzq5XjAg8v9hXWwIxeeWfoK+VFD+2gS5iBo1k1w8 X-Received: by 2002:a17:903:11c4:b0:1db:b8f9:ea69 with SMTP id q4-20020a17090311c400b001dbb8f9ea69mr239054plh.34.1709155917824; Wed, 28 Feb 2024 13:31:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709155917; cv=pass; d=google.com; s=arc-20160816; b=XpbbhIFeyYVgeAk3Ehhe/i6onwOSL+9X+3PERPWZwgeJ3jRP5yIvTpkKfCz+abIcLx BHZgP5inEZtZtDIzExOOz9GuEh/MkFfLOLXuqD3OT5iWi25e+MGVwFEgy88AaFMcZCGA 8/DB8a71KBk/b/KOMPzChcl5de5yDMwddHSZkt5LfQlGQw6VUW8xZlfdSFnDKgwEh7tE yAHTbFSafedFS78eKgaU8ogTI3dcUNoeQQ86WBJ25wwItC2ijn4Z3z5CoATSCn9+l4ZV GryAsEd6raxloxd6Kp2KNhcMf6qlVwdKtb4FcBkGxs1ZeNVmTip3dh1Et881nErSvQc+ FRgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=n0wYqBpadC2GPcjoScnXRQwP/YIIDV0F+XJ5Z9MeLn8=; fh=tp57ZCsx7UGLsJiFkEUQTPpTv5hE+bKQZLxL0RMdvcc=; b=YBAjCvmZLhOmD8jKH3mdPuBpjtKyS68EftdK4iNy5Q5HFchL9+53nXWu99z5TSrMhM OFVJevEkp8jUt7rdu9E9HI9PM3LF9u3Nb2f1SQtaRfLJT6rJ2CW2nOZuewUUzuAzR90m CGvFWr339TtWapbOZGVkYQ/LRoMdEBXyC19FQEgRDcTF8xD7Wykkb+x0AiwIz9t0xMyQ Yz40Gm+tZj0Nkgkv4tupq9jCEjaMByeY/NiXJ7vMqCM/yn1KMzsZwW3S/lrWB0R24aKX 6oNPwpz3hsWVczhZZFLxzYJ/vYNtEtOXQHLrKUryuwDv/aCPfHxIKceS2uPFUPijjiCh GxDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MyfdGmBe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z12-20020a170902d54c00b001db7c8f7cb8si4262806plf.24.2024.02.28.13.31.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 13:31:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MyfdGmBe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 78E0AB274B4 for ; Wed, 28 Feb 2024 21:16:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2421F8627A; Wed, 28 Feb 2024 21:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MyfdGmBe" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48DD786241; Wed, 28 Feb 2024 21:16:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709154965; cv=none; b=IVpxgG1lODtDcaqKk6jHyKua4Cr3npYSlaTKuhU6pFYrIw0pOnjoHYALeOH6rAVIQMdH6QzZ38KgLDxvdzayRK8H23c7Q7r2vAY0bCG/RQHvHdLvoaGE2pIdtBQhgRNTpgW7R1AveHdQSBmmrJDPlY67KC929HC5nH6D/Cl6UQs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709154965; c=relaxed/simple; bh=tLkK7HiFrVQn53zl701UulLerP36hjLPt8SmsC1MkTk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KhuBxgI40V+cAA2fSKEzUi2atsf3CIkv6AYXOraXIIoN/1HlcdejsxLp5dRmNpysWGeuC0KvbXmyFWIdhmuPreANLU3bMSc3fQq3mnW90toZ5nCCKdKwPsby3LnPWgKzDO3jwzTwgkw+9MDVn+Z84vqzikEu05yjhBmNQqBdKPk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MyfdGmBe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2F01C433C7; Wed, 28 Feb 2024 21:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709154964; bh=tLkK7HiFrVQn53zl701UulLerP36hjLPt8SmsC1MkTk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=MyfdGmBeVBLalf5giO0n+MQrpOq+iPNQHM0R+9NNdIYnulltiV2k/RVRaeirND7S/ sU58XtolspGI+RdnAPDRwdavPOJsTfJX5tc3rmldx94VMtIsXb93MikONH+uOLi7OI BMaas0mlsjstsLgRoPUOcsXDUV7PlCv+YyJD39bXMpIH/Whg+3l0RVS34tv2bikh38 cZPvsenq2CSl/i2jbGlGTMdq1e+/aPKobzYGidKboKXuz3D8lsrVxxFZk6Oa0VuQET 5oZBFCCa96atXwe6I2se2DGPNfXyB7We4rtkpc2Ty0c2fBsCTD4/32+xTY3aCfgSk4 non/64E3Ik7yg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4A0C3CE03F3; Wed, 28 Feb 2024 13:16:04 -0800 (PST) Date: Wed, 28 Feb 2024 13:16:04 -0800 From: "Paul E. McKenney" To: Steven Rostedt Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Ankur Arora , Thomas Gleixner , kernel-team@meta.com Subject: Re: [PATCH RFC ftrace] Chose RCU Tasks based on TASKS_RCU rather than PREEMPTION Message-ID: Reply-To: paulmck@kernel.org References: <20240228152236.7a4c9eec@gandalf.local.home> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240228152236.7a4c9eec@gandalf.local.home> On Wed, Feb 28, 2024 at 03:22:36PM -0500, Steven Rostedt wrote: > On Wed, 28 Feb 2024 11:38:29 -0800 > "Paul E. McKenney" wrote: > > > The advent of CONFIG_PREEMPT_AUTO, AKA lazy preemption, will mean that > > even kernels built with CONFIG_PREEMPT_NONE or CONFIG_PREEMPT_VOLUNTARY > > might see the occasional preemption, and that this preemption just might > > happen within a trampoline. > > > > Therefore, update ftrace_shutdown() to invoke synchronize_rcu_tasks() > > based on CONFIG_TASKS_RCU instead of CONFIG_PREEMPTION. > > > > Only build tested. > > > > Signed-off-by: Paul E. McKenney > > Cc: Steven Rostedt > > Cc: Masami Hiramatsu > > Cc: Mark Rutland > > Cc: Mathieu Desnoyers > > Cc: Ankur Arora > > Cc: Thomas Gleixner > > Cc: > > > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > > index 2da4eaa2777d6..c9e6c69cf3446 100644 > > --- a/kernel/trace/ftrace.c > > +++ b/kernel/trace/ftrace.c > > @@ -3156,7 +3156,7 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command) > > * synchronize_rcu_tasks() will wait for those tasks to > > * execute and either schedule voluntarily or enter user space. > > */ > > - if (IS_ENABLED(CONFIG_PREEMPTION)) > > + if (IS_ENABLED(CONFIG_TASKS_RCU)) > > synchronize_rcu_tasks(); > > What happens if CONFIG_TASKS_RCU is not enabled? Does > synchronize_rcu_tasks() do anything? Or is it just a synchronize_rcu()? It is just a synchronize_rcu(). > If that's the case, perhaps just remove the if statement and make it: > > synchronize_rcu_tasks(); > > Not sure an extra synchronize_rcu() will hurt (especially after doing a > synchronize_rcu_tasks_rude() just before hand! That would work for me. If there are no objections, I will make this change. Thanx, Paul