From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC101C61D85 for ; Tue, 21 Nov 2023 15:19:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 501CF6B0472; Tue, 21 Nov 2023 10:19:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B0BC6B0475; Tue, 21 Nov 2023 10:19:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 378406B0478; Tue, 21 Nov 2023 10:19:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2579A6B0472 for ; Tue, 21 Nov 2023 10:19:20 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B635612097B for ; Tue, 21 Nov 2023 15:19:19 +0000 (UTC) X-FDA: 81482320038.04.242E3C5 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf04.hostedemail.com (Postfix) with ESMTP id EC48B4001F for ; Tue, 21 Nov 2023 15:19:15 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AJkJFmKT; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of "SRS0=TAUs=HC=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=TAUs=HC=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700579956; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vbrJsbU3uvgTiZPp1pAY5eST2f+pj9Zoz60b73D7+oY=; b=tJZ0kT4EgT7cWNEcqjz/KWzft9MvIiZ8oPj8kLqih9HXNxxHtxvnKl4PbaBZ13vOta0TyV MvSMVwsi7/RAIO9zhWOOsYfDMlN32Q0tiIPl18r5uCEt4u21RVcXDCpoJtjBNxTX/BvWA3 i7aDsJZes8K/nyiAwt4/ieulGwyPYU8= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AJkJFmKT; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of "SRS0=TAUs=HC=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=TAUs=HC=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700579956; a=rsa-sha256; cv=none; b=UVlgSy6EwwztkD17MU/YLfdfFj3T/1FDQVNI9QKml0NWt5FguYkPO3uk6fEUCwk5Q/kk4w qfIc+EekwJnkIEqPgop1ib6eCSVrLr3Z7syHBijpbDZtdRVHLKbXQb70IhFtkvyz6ZHFly r6MkHA4c+5Nf7JoBC4nhsmlj4DJcYPk= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 36874B80FF0; Tue, 21 Nov 2023 15:19:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F76AC433C8; Tue, 21 Nov 2023 15:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700579953; bh=K3sSRhtDf+fwZgA5mkg5Iue5aOfsePsvpgVGRWm9MOw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=AJkJFmKTk3kZp2Nhtst+eqRQzgw6PQ+XkIGQaZksdF50rSe4nCfdicUzkfsZ9xj3Y r+9VX2YZLiP0kmij9QHNoR4mehJ7RKvrlJaCXBYFDUAirhyV0HjQMlBTIyNZ/gUS24 AHiMYihwNpSIdaFFObrHcIiWNcqh8fAwY9JTzqzkCVc80gqD5MWH/lkd70S9hmVXBp XF3+bipFXYDNPcmzm4TQ7AWvRkRxBTJUVjRRSs7e2N+MS/FJTgmgcH7vlTnMsHPANq gUdAEftCyHnzkcnFYu9YxKTGMgHD93uDwxTZgDWhwOwzHc3deg0o3S/gFwLsVUfPFh c4xbjk7FEa/Hg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 17035CE04BD; Tue, 21 Nov 2023 07:19:13 -0800 (PST) Date: Tue, 21 Nov 2023 07:19:13 -0800 From: "Paul E. McKenney" To: Steven Rostedt Cc: Ankur Arora , linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, jgross@suse.com, andrew.cooper3@citrix.com, mingo@kernel.org, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, David.Laight@aculab.com, richard@nod.at, mjguzik@gmail.com, Simon Horman , Julian Anastasov , Alexei Starovoitov , Daniel Borkmann Subject: Re: [RFC PATCH 47/86] rcu: select PREEMPT_RCU if PREEMPT Message-ID: Reply-To: paulmck@kernel.org References: <20231107215742.363031-1-ankur.a.arora@oracle.com> <20231107215742.363031-48-ankur.a.arora@oracle.com> <20231107192703.1c493431@gandalf.local.home> <20231120224356.7e9e5423@gandalf.local.home> <29984609-14e1-4ce4-864b-87932ba3245a@paulmck-laptop> <20231121100030.3546b702@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231121100030.3546b702@gandalf.local.home> X-Rspam-User: X-Stat-Signature: wyginsrkgr84u66i8sfjwhc66itdo75t X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: EC48B4001F X-HE-Tag: 1700579955-480225 X-HE-Meta: U2FsdGVkX18B9Tz5Qip4BsFpUZaY9DHelV6x5SF4BmDP7cowrJfNIc3QM0ij0aj+L88qi3BG1LGvEeThxBTHM5XSdM8F6jyq1G4XLxxOjMwMi/o9Mm0MOdfZ+sFjd1OzXdCFRsz1K1pLEp8299l469rBEiqmi395DkmeWCSSALvTqG9HopI8E4LdMsuqsWX/kWtHCty3Kfs+AC72OgPVmbXN25B8GhXb/QhsKsNgsefSc7dGAwz2vni+J/ez6WsrW5mhcm4Ow9mwvieoAY4hX7TWH9/SP3B5dCMWK2rZ9W/xQl6hNJ3QDW9fkE3zaeT4QdlKDQEeicQIlo873770n1gEEaxQ0mDAgylsCx6dD7p6R1LL2/b1/GbhJ99HnGT76BXQ7wydcEa0SIKokd1UoRIpNvHJWIcHgCO7PmKJivuaXoV06nPcb2liBvEfhCZR/4SrGIxrymHq9u/kGsQPEj0PBL4dX3ccDiA6INLF8I7z9RvmajkoLKs/gmru7oGWw10C1/OqyF3AWYLqmRn83/UFGdMyoHCAos8BVjEdGLsdj7jFdOH8JaWT1izFJqAp1aZ6mzxuPs1sSo6R5spFZbGKyznEU7/pzNOCgT3TX1Hky1szqH/7gWPImzXZsDPCwbIro7bx7AH9MDWTLjMQivc36XYrlUZ0/1jS3iuJcbjMijqKnVEsI4lQlzoPeQ9uJ1CUkL1fV6UA9J1CI/CkdOGjRf/Mh9KpiMamCBIT/609EtaP0yzzb555qUhipJcu/7drDAP5mtiMCu5641a5kzCVJnd1v5oKevC/gZ3MyzW9D6xefY+wsUG9ulPf/s2fGkEw3rptgtapcwuyIHo3vjlshDU80LudqRG9nkZAxruDXVIggkL6W9HIuXBbZ1mtwuIJv35Qjbb6X//ExXgv9XRBzVeQ7XU4FJFC2/f6hY1peFhociwEEbxiGSErAWe4i3v5pvGUOcFXX/NFbxl 7FCdT6dw e6KZDzrCOBdUqUwHkYLXhla6OpOkULOWxqpt6DuInXa/RKsuN9tM6QYIteNa+0dxs2nUx0+wWM+YhNlR+H/CAwv0MKqYpKj1JILmFCb7Cb8/7rQresNP7i8/LNCIV6kw6/AtPddDE70BwXmpDkPkq2fxFPfiNJipWENFmmnvZnSalbuJ2EsvK9qkLCbOtG2Kv+XaVxLeM20R+DyKa5AqX1mCV+nQnaB8MQG5FdyBTlg/ozn2LY7dmQutz93zZXziwFk0vKilBpHViSVPbTAJlbzvrkErM7qoDWKuv16bzbIEYLzyqOBJDO/g6IOAX3REQgSFPTUInLgSZrJJGyNizoX2V2HYU4Jy5DTUf1nNUFh1zTYRkA2mAISAA9ECSLAd9nqJSA0Hbqol/1Ef8j1PHHJLJsHeeWtNe9yzELK4D1ODP5CerERWDN2kb/dtyanTh93Mdg6zB2dwZo+AVIfD11hT1jLmDbskisRINkMlj90wqIcaBpMc1M8bA79l0Y4Muk54uZMKwwGjytouQlM9QszG+CUzuW0SQfWr7EFOSlEd/NrQNC/GR8DRyBORoddp/PTojKQxe0cEn3jr05vlGMLFbz1T1ikthdc7xvnWj4dMMI3r6lVZ0vMq39yXckOerwnwOZElK+5pOz9BDaQeXhFzoeDm9CvMcmtUhSplQan2EPZ9vIKTE6LKoQw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Nov 21, 2023 at 10:00:59AM -0500, Steven Rostedt wrote: > On Mon, 20 Nov 2023 21:04:28 -0800 > "Paul E. McKenney" wrote: > > > How about like this, where "Y" means allowed and "N" means not allowed: > > > > Non-Preemptible RCU Preemptible RCU > > > > NONE: Y Y > > > > VOLUNTARY: Y Y > > > > PREEMPT: N Y > > > > PREEMPT_RT: N Y > > > > > > We need preemptible RCU for NONE and VOLUNTARY, as you say, > > to allow CONFIG_PREEMPT_DYNAMIC to continue to work. (OK, OK, > > CONFIG_PREEMPT_DYNAMIC is no longer, but appears to be unconditional.) > > But again, I don't see why anyone would want (much less need) > > non-preemptible RCU in the PREEMPT and PREEMPT_RT cases. And if it is > > neither wanted nor needed, there is no point in enabling it, much less > > testing it. > > > > Or am I missing a use case in there somewhere? > > As Ankur replied, this is just an RFC, not the main goal. I'm talking about > the end product which will get rid of the PREEMPT_NONE, PREEMPT_VOLUNTARY > and PREEMPT conifgs, and there will *only* be the PREEMPT_DYNAMIC and > PREEMPT_RT. > > And yes, this is going to be a slow and long processes, to find and fix all > regressions. I too am concerned about the latency that this may add. I'm > thinking we could have NEED_RESCHED_LAZY preempt when there is no mutex or > other semi critical section held (like migrate_disable()). Indeed. For one thing, you have a lot of work to do to demonstrate that this would actually be a good thing. For example, what is so horribly bad about selecting minimal preemption (NONE and/or VOLUNTARY) at build time??? > Right now, the use of cond_resched() is basically a whack-a-mole game where > we need to whack all the mole loops with the cond_resched() hammer. As > Thomas said, this is backwards. It makes more sense to just not preempt in > areas that can cause pain (like holding a mutex or in an RCU critical > section), but still have the general kernel be fully preemptable. Which is quite true, but that whack-a-mole game can be ended without getting rid of build-time selection of the preemption model. Also, that whack-a-mole game can be ended without eliminating all calls to cond_resched(). Additionally, if the end goal is to be fully preemptible as in eventually eliminating lazy preemption, you have a lot more convincing to do. For but one example, given the high cost of the additional context switches that will visit on a number of performance-sensitive workloads. So what exactly are you guys trying to accomplish here? ;-) Thanx, Paul