Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3982816rdg; Wed, 18 Oct 2023 11:13:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiSBCfH4Dam3Wgy5MrDLsFlx6QCGf9/YD0ry7DQm4XJ7bRvZjAV7oPe6hno7Wc0YJfT2cj X-Received: by 2002:a05:6a21:339f:b0:137:74f8:62ee with SMTP id yy31-20020a056a21339f00b0013774f862eemr6829788pzb.18.1697652812175; Wed, 18 Oct 2023 11:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697652812; cv=none; d=google.com; s=arc-20160816; b=rhorUkNdwKad9Cnh/eit7pXYhYR5AbfTIxOJJ1E7LCMGwI1TlUc6xiF0HSO900l5pq 8MBrXeTDCjZU9lppw0SDJ2lmZoZ6/lmCPMqjLeYcvK86bQpeLrFCBl2bLN6kC+u/PeJw I2dvX3Fk1Ox48I9uby26tnDhz24zIOdpDsI6ao2ZIK9ZFdN28VjchC1LoYLQBwFN7fxu jT7x4FFOz6XJ6T52kBwYCmlqe4T5VKRwJdMvGY7XO0I/kqD5q39TQ/YluBjUDo6Thdb+ unto//gfuyCmVPACPuqOuJ47kJ+QFuP1dnq63Ai6LFD0qs6H/y47pRsf+9jpj/30Rb+V QMGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=aA1I0Jw0jKlFigyEEKNZ5VvF7ndNZs81F99iSLd4HYM=; fh=79cutc6+adEf3DakPqR3An/cJK2bgOHoXXpd8XMfeOE=; b=ksKAI1jZ0urr81ZTmFaJ9TE54NcNBdNSaV5c4VN6wtsmTxJRfVyYeIo9MstwrA7DA8 xZABsNKC0NEP+Al8D3g21MAGF89ZOhRw4K9iAGw/8P6fqIybdpk7RHuWtWMURLyiiwue etnjxonFvXCziMeWi0C0wWhbgvJJL+BLuUj7hiO8gdPf1rejJwczZBDs2P+MB/xU2uCK Ew/hjQLi8ZKyUZ4Yt0OXbu+GEZOtiCYw4lpykHZ40345pH+IqDBaKgwsJ3bpyQcxWWFj L0xbOjwrfnE6Jt72ecwmCT8OvjmFgQMzvGotuuH81UCnG6K7XnGdWREMnun1VrZXwLG8 GGVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IIOasrIM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id w63-20020a638242000000b005852a35aff4si2995335pgd.227.2023.10.18.11.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IIOasrIM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 919DA8063BDD; Wed, 18 Oct 2023 11:13:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231848AbjJRSNU (ORCPT + 99 others); Wed, 18 Oct 2023 14:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbjJRSNU (ORCPT ); Wed, 18 Oct 2023 14:13:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC1B98 for ; Wed, 18 Oct 2023 11:13:18 -0700 (PDT) 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-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:13:29 -0700 (PDT) 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