Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp68124rbe; Wed, 28 Feb 2024 12:20:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUVVfahaFuePNi0MQNm0s8isBDjHjZdmiq/+082IIzm3Sg2xe4JOpB6GvNON4micXxK45F9hYsC0+uk9gORy7SLlyajRh1dZSRLeTv1/Q== X-Google-Smtp-Source: AGHT+IFepaX23qVQMdfiW3HFAy9NRNEnS2E6wLGxuE6r7F7eqDEdIj6EfTtoLX8DrG/9CWySbjD6 X-Received: by 2002:a1f:eb81:0:b0:4d3:355f:bc02 with SMTP id j123-20020a1feb81000000b004d3355fbc02mr718314vkh.2.1709151642981; Wed, 28 Feb 2024 12:20:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709151642; cv=pass; d=google.com; s=arc-20160816; b=FUqBxM5VKErBYEn8VOo/ysZthFtLFlmbp33ut40pHtGly0u8hJloOYMEFjHQxsOlC+ LnbeqzxH2ZZqrjbLl6SkPbt5uC2MBbjtWOralvGLdklVBABUZ11bC6VYb/5PY57tH7xd YBJdMjh7knoi9Xim+D0+nj2waBFFYWlKglGIaRikEhCvpsHOWRq+jONt9MX2ByfsQhCp /5hhar5Z7da86TUZiZ3Hp9a88Blho0R7i3ctGIWOZeiffhzsNMgmnMjMUb3Ae99lXiih 2G+z4WcfG1BI1MW15IwND6kAmwiPMo7JAsGDNiTorP0s2JFhG2ROBZzrMAsimpxxOQz0 Xvbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=YTZYAYvyjtmkzdcl+WsKK6+lyO6I/SHOGTPSaA956JI=; fh=lTyHcI9I8FdQ4lXujQQ12l5Scl6SoZFNhnWezYWyazI=; b=Lpx0Vha9gC5Qk2cxhQJll4I7KgUfezbdBJbZ+1p5grHWM+29caPABxz1iF/HVlbdDA wI958DbL8+yIUGRDCMsiYJliIZzM8pNclda23dXoVAs6RfbJXdVJKOWm8Xv4WFsi/MsN jWpSuvYBMK0ARieOllQdnqscnyjYKRbWkRRMdaPUjsPQK6IOu0TE+8C6aOkGRYylM5jI TnEN4Z9g7XU/qDnwETkLiNeQoTjXmDSfVt5P5lN4OYI3ArYVKdgeUp+il39NMsYztmiH vVa59KL5aFv27CtjSwY6FHmPqf6LCRzTif9pIVJ9hRSlmgIK1IcV5OSdlw1/axihXyu9 3+rQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85670-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k6-20020a05620a414600b00787184953bcsi308210qko.720.2024.02.28.12.20.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 12:20:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85670-linux.lists.archive=gmail.com@vger.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 D5D6E1C21C27 for ; Wed, 28 Feb 2024 20:20:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83E1F7442D; Wed, 28 Feb 2024 20:20:34 +0000 (UTC) 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 0A1085E082; Wed, 28 Feb 2024 20:20:33 +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=1709151634; cv=none; b=j3PX9nVKWIJbRyAaeJc7t8eWw7sf0p5QOs10sxefchb4jon/s7Gl2Ge5tlZYwAa3yeh8u6R4qwQjy9RT0TTHpJ1a+Dyp/ztQuTfIIo6sUGj9JZ+q8tpVfxJ+7PTBSxZym1pic0tMPcPHrV5JXLV9NKFljm6ex1SU0LBrpIxAmO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709151634; c=relaxed/simple; bh=YAtFYPmb2SAHktjqVXsdcZBKF2SuuMbdEdsoHa6pIlA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EDn3YK63wpBA35MQwB/UBSFCyh2zQTLCYoIkCWwbADkxRtaPZIGVXdsNGW5b8OZpnxSQ2f66yMEIc5lXOA1ZwD3cXnL6XkR9Gew4gnqw7zkfFPeDj7zkyO92WlH1+0Kn8VqZsOKte0I1niKOEpHIA3q6HIu6ERErjntN9TF0vXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B551C433F1; Wed, 28 Feb 2024 20:20:32 +0000 (UTC) Date: Wed, 28 Feb 2024 15:22:36 -0500 From: Steven Rostedt To: "Paul E. McKenney" 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: <20240228152236.7a4c9eec@gandalf.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit 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()? 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! -- Steve