Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp131397rbe; Wed, 28 Feb 2024 14:49:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXe97T/0qEiZjaDblkNV7OM/PAqS0bzgErY7Ma6qCGxyHI5FncGSUFYRuw1ZozRODGWzypnEXNc+d/hJ6h3zBUGpZsaVyBuAN5TLFhXpA== X-Google-Smtp-Source: AGHT+IFbiIuwlkRhrA1dRz8Cjk7A1ZNGxD5fc5ETvg8aQUEF5lmoanI7oBqpxP73eXDXzxVeGnnM X-Received: by 2002:a17:906:560e:b0:a3e:7f80:ecac with SMTP id f14-20020a170906560e00b00a3e7f80ecacmr78151ejq.12.1709160574374; Wed, 28 Feb 2024 14:49:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709160574; cv=pass; d=google.com; s=arc-20160816; b=x2/7leaNi3aMMB1j/W0I1eUbZQMW2dP4W/idI2vBDTnbTORWQm3UJd91ntaodvlZU5 i5i6vSR4f5Km6NnRu0WyKpWPrEwoX3DGe1bvpyS+KYNrP/PwqEkPieo4tZMrph1ugQVj ijzdeuWGy+n937tc/obj7OSe6V4ccP4+ZdZRVeCx5Xd5dN+nQQv03+Ospma+mgsNdshb CLJucWPRsiOcZcq2ZCuej6c7ok6IsgzULbdb8izvUNuQwjdUqUKbpUXMVXHPmEzIPdcq ULaCEdHT4JLM8Ffl8F25G74r8vXS77dPePlyi6sxlwbr4gi2PJvxPt3UNQqDqdOAKtIB /egg== 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=ZxYTsm+A81JmR9JClNX3IDVaJ2e4gj1MnlvLHiEfN3c=; fh=/nkqPA5eO5nvR45512ckxE2RSWVFZm4hJMRGRz1p6vk=; b=LhNRrI0gF/tzMeHzyP704uibo3Pz7hfj3wb73On1NdycW68I0kI2ew4mINu1EsuZ1G e+jar9dVPbXOkWCLQGRqxVwUUN8+Ep+R5t+WkZORiUMXQRCW6nC6FdeabmKhicj8PXpv MbTHc57MKqcQb3d+DCMe3WS//UBzdgW7R7RF9hns8MPN159PBekQsuBx3Jw3/1x9wJLd zsZBRq04amzvuXiEfL2bwW9k8HaH+7dXxXvge/gtmmWxE4flkCmYjpWZ1X+11mYSZYuj 6oqWXn2rLd2CMmD8SodCXuKGUAxVZ/HGuKHTLXMtRa25DwmJ1zT32oY6w0QyzeWeoLRD tuCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DDAiNwqx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85801-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y63-20020a50bb45000000b00563ce99a187si2003516ede.539.2024.02.28.14.49.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 14:49:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DDAiNwqx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85801-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 275EE1F220FD for ; Wed, 28 Feb 2024 22:49:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72F3972910; Wed, 28 Feb 2024 22:49:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DDAiNwqx" 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 902EA71EA1; Wed, 28 Feb 2024 22:49:16 +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=1709160556; cv=none; b=hMeB8ebCc6IhOom1dQ+2ee8amDRlyaXU07DIxJ9suRINd3mPRBcGomdH5EHzsuMTZfychG/rB9BFiXTjo/TZqrs6PrglImoGb9FpmVV0OvqF1nmrzJNX+TFx2JWoQIMIzogMk7YCmeVieLJYzxYNeKhLte3r2PZsTsSrVuZHU4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709160556; c=relaxed/simple; bh=Pz9CnoezD/dgggmHZ3jrf8PSRKN8xh1HR0itqdgzHns=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZVAsTHNNAYMaopIHEtktVusp21OPPnHxD8xQFwpmAOT1GoefmvuZVkSeFf1OPncucDCL+kY7hhEiCkX5XSLPsgB32JeVtTPyqEpyJiYDhGJ6OQ7ZkKkxwwfVon9WjaVC8CCA9ebo+jWHxSdmPx6eJq6r01tYZF/lMlafVl+Lo94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DDAiNwqx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1718AC433C7; Wed, 28 Feb 2024 22:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709160556; bh=Pz9CnoezD/dgggmHZ3jrf8PSRKN8xh1HR0itqdgzHns=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=DDAiNwqx+QFzs0aDq1cZJl97xgt+E/dg1Af4G2GKL33IXpDj8V3cWpBUTpQaAEbA8 8BdPe8jeJKVBgwhxZM8YwycQ0CBjFu5d+dQZgPntkoQraatbu+xNqN5kQE/W7yDZO9 EnKx/GLbjSM5KEff5lED6jUWU7OGdi67V4i96UO/QM//7NEBrh68n7nBTg+R/BpEub ILiifH/zub8EF+lKJ/MoYHWDVv1B7d4qpUrwi3McsbgFZk/+/qelCZ1AzjVTkY9PnT Av7XpO6wqlQceFttGkfsj419JZadiMHwaj9oVmz9xVARRlpDwVwgKNNaqN7/P7lap6 HR2r3PUBnRvqQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A9DFFCE0F91; Wed, 28 Feb 2024 14:49:15 -0800 (PST) Date: Wed, 28 Feb 2024 14:49:15 -0800 From: "Paul E. McKenney" To: Steven Rostedt Cc: Joel Fernandes , Yan Zhai , Eric Dumazet , netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jiri Pirko , Simon Horman , Daniel Borkmann , Lorenzo Bianconi , Coco Li , Wei Wang , Alexander Duyck , Hannes Frederic Sowa , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, bpf@vger.kernel.org, kernel-team@cloudflare.com, mark.rutland@arm.com, Alexei Starovoitov Subject: Re: [PATCH] net: raise RCU qs after each threaded NAPI poll Message-ID: <1880cb02-d259-46d8-b4f7-0b3e2e0f0745@paulmck-laptop> Reply-To: paulmck@kernel.org References: <02913b40-7b74-48b3-b15d-53133afd3ba6@paulmck-laptop> <3D27EFEF-0452-4555-8277-9159486B41BF@joelfernandes.org> <20240228173307.529d11ee@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: <20240228173307.529d11ee@gandalf.local.home> On Wed, Feb 28, 2024 at 05:33:07PM -0500, Steven Rostedt wrote: > On Wed, 28 Feb 2024 14:19:11 -0800 > "Paul E. McKenney" wrote: > > > > > > > > > Well, to your initial point, cond_resched() does eventually invoke > > > > preempt_schedule_common(), so you are quite correct that as far as > > > > Tasks RCU is concerned, cond_resched() is not a quiescent state. > > > > > > Thanks for confirming. :-) > > > > However, given that the current Tasks RCU use cases wait for trampolines > > to be evacuated, Tasks RCU could make the choice that cond_resched() > > be a quiescent state, for example, by adjusting rcu_all_qs() and > > .rcu_urgent_qs accordingly. > > > > But this seems less pressing given the chance that cond_resched() might > > go away in favor of lazy preemption. > > Although cond_resched() is technically a "preemption point" and not truly a > voluntary schedule, I would be happy to state that it's not allowed to be > called from trampolines, or their callbacks. Now the question is, does BPF > programs ever call cond_resched()? I don't think they do. Nor do I, but I too must defer to Alexei. ;-) > [ Added Alexei ] The other issue with making cond_resched() be a Tasks RCU quiescent state is that the CONFIG_PREEMPTION=y version of cond_resched() would need to stop being a complete no-op. Which actually might be OK. Thanx, Paul