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 5E25ECDB483 for ; Wed, 18 Oct 2023 18:13:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA8EC8D0183; Wed, 18 Oct 2023 14:13:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C58BD8D0016; Wed, 18 Oct 2023 14:13:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B21818D0183; Wed, 18 Oct 2023 14:13:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A10C48D0016 for ; Wed, 18 Oct 2023 14:13:23 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6BC47A0DDB for ; Wed, 18 Oct 2023 18:13:23 +0000 (UTC) X-FDA: 81359379486.14.A0A75AC Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf03.hostedemail.com (Postfix) with ESMTP id 75A9A2001A for ; Wed, 18 Oct 2023 18:13:20 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IIOasrIM; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of "SRS0=oRJs=GA=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=oRJs=GA=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=1697652800; 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=aA1I0Jw0jKlFigyEEKNZ5VvF7ndNZs81F99iSLd4HYM=; b=dr+96KDYvDhGHWCulx/IlKvZgtpu6hbGMpbhLiVkNxqiOhAYbeWyE3TYoBeYOTownl+X8k VYWcJOWfczeU8epT1bQ0ISf/bNpMe+ZBhIFJkfsYDe1Q5vbCVECZPuer26cGFCtDnDAMcQ QTeVplkkBBO0b6uFvdieGqGO+0cvboQ= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IIOasrIM; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of "SRS0=oRJs=GA=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=oRJs=GA=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697652800; a=rsa-sha256; cv=none; b=1OS9+rWdjyX8LyAIOCgGMDtH5gVkX3jwM8booex/HLdtmnlAgiQE29gZ/9BmjOA3k3iaYl srrnNBiUK0g6+cn7Uj1qkcZk69Ig+KSghogRh1+MALpwj3xOwVIW6NZeTyC7X7gHcal326 fYs5W8HJ3aeepPXqvDdi8gvoF/SMP9c= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id CA71DB8244F; Wed, 18 Oct 2023 18:13:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DD34C433C8; Wed, 18 Oct 2023 18:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697652798; bh=/5tzr5CWv4KijS8Ooc9na1PJM05K7T5Kk3SSmP4w6vY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=IIOasrIMBAbX4CLhg3deTsjXR8yFA57r50gAu3R5/kvkGPRzlzn9DMwSDj3iURR+a vSqOFSSSTvFpRTpXV3EONc3rdGtS34LCP+vrBnl9hm2AD0m2QKVhAZoGryetUK36No esin8l5jYx5nmlCUeqRRN09SgVcmDuUOc5qEseq1oNUDFW8Y5SXE3vyA1qaJcd5GWB Fnjrhho+zTPWt/9BoO2d1dUe0oQ8VLx1iGOGHYRwuqHa9/OpeeJK6QBACIvWPb4pFe 1TbFfbMmPjhlk7aA0pAi6sZRVtNM8nZSkQZIUwRPEgg11QkRz/FbHT9zit1FiWxaOM B17p3keRBw8GQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A3B86CE0DE3; Wed, 18 Oct 2023 11:13:17 -0700 (PDT) Date: Wed, 18 Oct 2023 11:13:17 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Thomas Gleixner , Linus Torvalds , Peter Zijlstra , Ankur Arora , linux-kernel@vger.kernel.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, Frederic Weisbecker , Daniel Bristot de Oliveira Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED Message-ID: <98f9ff35-5d71-4706-afe1-7e039afbcaaf@paulmck-laptop> Reply-To: paulmck@kernel.org References: <87ttrngmq0.ffs@tglx> <87jzshhexi.ffs@tglx> <87pm1c3wbn.ffs@tglx> <20231018103146.4856caa8@gandalf.local.home> <20231018140035.107f5177@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231018140035.107f5177@gandalf.local.home> X-Rspam-User: X-Stat-Signature: a6hy69eghawg99185x8czfhxeqc4z3bm X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 75A9A2001A X-HE-Tag: 1697652800-476483 X-HE-Meta: U2FsdGVkX18clL5UcKtYeF9nC5yQlp42AZ45QLihbBTmvzA+RRL+/pxUMn9FGO5AORDnPYwC/W3E4Va3uHhjM9uOJAiih/E+ZV2TTY3hbRKm8B15jpRddlb+aFUiqE9RVYnaIRK/4JV2aaumaHk5hRVedu8tCNx8LEWvYjB3W6sFiwutKRPfBzxZw5Z3pcgTpXloCj5A9Br38eIFGrNJP4ZMPnboTx7Q+AFb1PWc2oQg0UbRc7YS5pAPVu8X6BhZhL5qriyEmbrcUPpQAi8v41aN1J0w6LjdHM8Ym9R1Jdx+jTukg3bWTPxqEZ8HYtCxGdKosDLlxVyCb5mzPoxV1dVHdZYuV7WUAjSZn2ZA/KYaIuDErFbBy3zWAXg68k1uswCgBvFpQCfVLNa1LPOKShckmKHopSxck8XRlVI7H3+Vr+c8DDsvMdRkDMhTgEFbBg6eu2G10VOiSjYuhHweeCONl6fRrsQ6zJYHmowguy4gh6n4kLTE5ju4oRBK8+GQwizM48dyp9ai7PwFDI8gkbpM0yJnfltCmH+EtJRwAcjqiGOIBKbVY7E9ZNqr7RVJ1U/hOrWD1D/JP/TGH/8u589t+Z4zhp5f6O1GBUBeBYRsnsCwvWQaOdgp2C4QhFIM9rSpN9+MgzJ0IKq2qRqildd2UVYyLy31vPYLqKYUV4YxjcX4Jv0dUIK8aK/84i7ZXPrqMkGWjJsG/CNGkNm+bmOpc76t/qc+ng7D88H/mrRwvyiPcQm8cB0S5YOXw+6yMOe2YULJrTy6oa75mOCFgzTYWoiNQ20v+4BYrjyVFiJ89IPhGF9FkFAYb0EcONT6y3c5aPqEFhHP2EyE6JwfiBxntWOaP50W2RHrhzrALwnYgZiG7xHCRcIjyq3mhta1HnLct6Ovq//Y2JX6Ion1yZILTtjQSCYbu8QeoM/QjJ6k9vbYOziQh2EAiNM3yKBPpr3bGYBsbNZbTywZoOd qRa3UAf5 4aDblqT3dcEonbSZg5ZLytid0OiTF93I4TnMGWAyH7ViXtm7RrB3G9EkhgRHDaD37Bcif+CInR3/DHKxkgUa8cvH1rJcwce+qbKxIIOc37LmDfc2OzHgTkBexNmB0JLBBJp8xtW9LEsHJXYlRURoENrcK6WvNViV/NC8muep5iyDLiC5xxKDGonx+FHtiNEbRDSePKGKqSFESXXK0WYNCF+3GUZdWMU6cZQKEy79nXqbghI8T8iBv4txx/SvRkbxfWkU+ZQcxYQNffPmO6HIaklOc4SmdGtO3Q+zsQBAjJ3DQohB5oeHuLQEIhPJjzCEO4a+zUhDiYmpuMVzOc+M2crXqLAAixphA2JiwdyEsg3tf1UoGMfiFeI4pS3sWZAs/N4Tq7X7gDtfHmtcTyZ4RcDpoM7jA0WrWKcir+LCevMCH+fatFxpjzq1VauTtjsWywS/Ud/ZreQi3PAhIhnTxDEIOgzBa2eCKAok2h6NrHTne6hKafyO5k+MjZpTSD8SOewK3WiGyGczDszjGOUrIfVGAsH7nDSjiElkvnyi+NAQC+2MH9MKGvKbT5G7Oj9dInswrVx/7Y2aBTAhsSjy/EX7CHNWnqL6BgTBRAxLJLrLVZcxRkqFCGP2tOl4QZx9KKofFV4R6nXjQItI= 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: On Wed, Oct 18, 2023 at 02:00:35PM -0400, Steven Rostedt wrote: > On Wed, 18 Oct 2023 10:55:02 -0700 > "Paul E. McKenney" wrote: > > > > If everything becomes PREEMPT_RCU, then the above should be able to be > > > turned into just: > > > > > > if (!disable_irq) > > > local_irq_disable(); > > > > > > rcu_momentary_dyntick_idle(); > > > > > > if (!disable_irq) > > > local_irq_enable(); > > > > > > And no cond_resched() is needed. > > > > Even given that CONFIG_PREEMPT_RCU=n still exists, the fact that > > run_osnoise() is running in kthread context with preemption and everything > > else enabled (am I right?), then the change you suggest should work fine. > > There's a user space option that lets you run that loop with preemption and/or > interrupts disabled. Ah, thank you. Then as long as this function is not expecting an RCU reader to span that call to rcu_momentary_dyntick_idle(), all is well. This is a kthread, so there cannot be something else expecting an RCU reader to span that call. > > > > Again. There is no non-preemtible RCU with this model, unless I'm > > > > missing something important here. > > > > > > Daniel? > > > > But very happy to defer to Daniel. ;-) > > But Daniel could also correct me ;-) If he figures out a way that it is broken, he gets to fix it. ;-) Thanx, Paul