Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp50204rbe; Wed, 28 Feb 2024 11:41:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX/ONvkcHnPbIWq1NHVubSLMvzWZGJmcrWROZoCodIrXDYPTU2LTpCyUlHIXKr80H7Aamw5UKJN6AM3FwlCWttISxewJbjNWk9KUg0NLg== X-Google-Smtp-Source: AGHT+IFiRM2wSZ0c6DDYTRZ/EU6YQAptMm/GJVopMCKoSSfEgPZgws0SkgIiLsid9d1D8oqUgTzL X-Received: by 2002:a0d:e814:0:b0:609:50c5:78ed with SMTP id r20-20020a0de814000000b0060950c578edmr49091ywe.21.1709149287340; Wed, 28 Feb 2024 11:41:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709149287; cv=pass; d=google.com; s=arc-20160816; b=PzWEHG3K8C9wrOgtvM0SItSYKtBufJrq+KGwOjhXpy7xQc8TC3mLnfMCTpEXHPO1mr y6dKlZOdnlpOkc67VZSrVLS6KeALOX4uw2d8aDV4YZ9QjG2OqV2DjnRKYy67GfGLd+3t LU1ji3XyQpUnAD2dmAYajLuYD5r8muSZLOj1WEGf1G5GzewHk60g8rNbUdWAdQL0plCR r4RKyKeNV6kFybWfaDOcyMXrCWM0b8wF9r+raDwuj5byMkceZXuT3LPb+bkjPsL1G51F Y+kfoyJsgXUdq7s78cynxFTDXXwp0Fh/j3Qw2BqABBgUXPyEgGx1i0Rc/syam8iRtFAE DeJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Mswom4W81eAfGBrrrJAx1kgU1xcOa1jdZNt+DroAE94=; fh=UHrhq233cCwHNLD4ywZGPj3Dd4S2gixqDJ66CgEmCUQ=; b=yM4L5gV93YYFFl1Jm3r+cNv8mEFYMUl1OW1vVP9SozWoaRcdmBhizzmiqgbsqYU0p0 uij8RtRXxE/V69E+HctpHoYknsEvS/ynWlKuQfRVlNExhr7XQAY+1ujZMNJSpXRqWxgP 1qeNPgfuZwr343DHBBhPqm364KoYa3UwPycH/V0IYO5258Nk1mwypS+8uCauQEh9/NXy ndGfCzOax8Pmf8VSlwtMmU8eCUudvd+BD6PjZ4LVjb6c8DrK54s1xGUtwuXj5WUF0F9D shgFns3+KYTaCfWD7qF1hL1cqmBkKzYE5REzODsJJul4UXgik+IDk70pDCb3UcdWQaqE Ruuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b1iFGEj+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85628-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t25-20020ac86a19000000b0042ea06b3827si139995qtr.137.2024.02.28.11.41.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 11:41:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85628-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b1iFGEj+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85628-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85628-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 839A61C26143 for ; Wed, 28 Feb 2024 19:41:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28B5A5E082; Wed, 28 Feb 2024 19:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b1iFGEj+" 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 411F55E074; Wed, 28 Feb 2024 19:38:29 +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=1709149110; cv=none; b=ixqUwtTl2ml/mM8JNU5ovjJX+35XW81gmD8QYFWfc0B9xZAb8YIbLL0S17Us4gHT0BpqyX2t4Gi7HMZb+9v0E4N5wW0g2laCetpq/frD4AnT5y3STD8YbpDVGtc9IxgT5Fxrfccsp4WK8PSV6S+sbjs8WbgfKOsKPsbgv2q05OQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709149110; c=relaxed/simple; bh=HKsFoZKnJ34YSBFn9vTGSnBy8Xop5g9WIhcVbvX1B6E=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=PlLGcavv2I/hTYDkl/aDk6B7vHhQVQzPFCP3omfDXkgF5o2V9H3S8v72FbpplNEjAXvVAqAKR5qLkfOi2BcFUeNCVx4sTqZRj/IeHS059FTACkYCY/9DauiT0bM+zuIMi/+I6aseNuqEswKyCUdZ58HXssSgaCYPfiRKupOfao0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b1iFGEj+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1245C433C7; Wed, 28 Feb 2024 19:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709149109; bh=HKsFoZKnJ34YSBFn9vTGSnBy8Xop5g9WIhcVbvX1B6E=; h=Date:From:To:Cc:Subject:Reply-To:From; b=b1iFGEj+idZwyXYGELoyOx0I31GFrOItcdTvZYjxdyO8tk9y57qABVza2+j3QCN0H A29rheh2pPAOD49LuBeKJpJIqBBsYQa97eta4qmyyyfNyNhFvTXmL1NiL27dQpYkeG FpR0WCG3KxMCRt9W3nG2R9CiBg5Rb7P7Sc7cgRW6Iy+mfGbB8MqdrCj2FFyqzbT6lj rDOscHOOnD6zgn+kJIvDlbEu+cxpOlQlplajPzfJvhTud8avA79bTKBaafKxVcxPVt i7k/NQc6vs8sA+USwz3sxgYWDkBsxqpEl7RKPqFcc8uqzEk1GRqzCp/XkOGbYlQz34 BbIKnWc2aq51Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4F340CE03F3; Wed, 28 Feb 2024 11:38:29 -0800 (PST) Date: Wed, 28 Feb 2024 11:38:29 -0800 From: "Paul E. McKenney" To: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Steven Rostedt , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Ankur Arora , Thomas Gleixner , kernel-team@meta.com Subject: [PATCH RFC ftrace] Chose RCU Tasks based on TASKS_RCU rather than PREEMPTION Message-ID: Reply-To: paulmck@kernel.org 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 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(); ftrace_trampoline_free(ops);