Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp498864rdb; Thu, 19 Oct 2023 10:08:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFv7Wax3SF/kg8rhXxAp5HZIEMk4ZZKL6rfsobFcSlcBXSdcaH1ggSMEHuEcYkNExnW3+dH X-Received: by 2002:a05:6a00:1394:b0:6b6:9f05:6507 with SMTP id t20-20020a056a00139400b006b69f056507mr2716864pfg.30.1697735307256; Thu, 19 Oct 2023 10:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697735307; cv=none; d=google.com; s=arc-20160816; b=dESlsNfGJuyRHATgrFyZ1VEpv2wadRhL0VIBKKMNb5d5wDeXvZmQdLyz1KLuiryo8P LGz824pzU8zQKAvpQ+PApznEQTo0wxG7deIbMVpdEQGVd8RkY3FYpgCe/1LC6suiPhsk enTz01j1n3d/egD+CdSWrlPwjC0ysudnGetyMSzqJ6dF9xQ1gR6m0l16OLe8ZJfUy/za zOX/TlNdFfQu9VMBMdw8PnGWxP4Q5YYKoKQpC+zdBiGRQ47BaemXykI28d4ux/Oto/32 RTARUo3Wc1qtuDX0jg1yzmiyUaSvqFRuiAWZS2gl14jHP8udCsNPruUMEqBauPiEw9nC i8Kg== 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=yvEz7/Odoy7XLIjoDZElFG3wrqx3BJ7NsYGoRRJfL+M=; fh=/evjsD1hW6m9sm9OuzsIINok0tpnfD44XtEdCOMFApc=; b=ccYq6G/x+i93YKDXE7aC9hOkgeZbII7RCe7MWTjAjvNZwxzFRsUgTl8FFUir+GfnXZ pn4TYHAnBUt+G6CVlzeO9I6P/XqPd3xmDmNBEusJ3jjc7pKJut+BMW6mIfdJmvthw9jD c459ngxCrui7Q1KqS19UzjYhbQ+LDGD1iMgjN/otcrz9lDG7Evvyn4R6Puwx6Olxj8/x XfT6+YZIew+1XvgX3O6HI8n9Ni7Iy8ebEd6xyeG652Do7ysKbnM0ESObp7zpMpqCREE/ 4tGJVZBEWUa7dphFrX9TJ4ubZqo077JuEpGeQymy7mQLfIY8EbioMCMwlq2rWxyeOUgk 6rzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pLjfFdKC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id y10-20020aa78f2a000000b006be3cf601adsi51567pfr.270.2023.10.19.10.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 10:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pLjfFdKC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 16CB681CCD9D; Thu, 19 Oct 2023 10:08:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345115AbjJSRIQ (ORCPT + 99 others); Thu, 19 Oct 2023 13:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235462AbjJSRIP (ORCPT ); Thu, 19 Oct 2023 13:08:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E0D1130 for ; Thu, 19 Oct 2023 10:08:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26875C433C9; Thu, 19 Oct 2023 17:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697735293; bh=kEzdmpSgsxge4iZIBXYMW8Gp5G9qVQ9vuxRAIEUfpFM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=pLjfFdKCKN12svlbXRJA6ki21TrS1ROSPHqtfafi41SnggTJHm1p2huPJK2mAYm7W qfSPlsyw2QbJFBDpSQB7wSxJwI4AJxo25UMQFmpQIDX+FO39EsOBhKmCsyF3/4M13J i001iXULoot0xzcFy32pMpLm0Wofjw96lT5izSCBJ0JWLkHuW+KPPrLrRzlPDSI6An zaYGvWKKSZIlZlv+Upp5cMnQoculcTZFscjUyUAXCFYXdWgvYG2BveJzn35suhiWK7 hDnGlt5VnSStQwl5eeK4LqawH9Nqm4zjvTctRkN6OSTtdpHL2q+tBhYjvxGoxVy3Bu f0v0AvGqZPi+w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A9EA6CE0CF9; Thu, 19 Oct 2023 10:08:12 -0700 (PDT) Date: Thu, 19 Oct 2023 10:08:12 -0700 From: "Paul E. McKenney" To: Daniel Bristot de Oliveira Cc: Steven Rostedt , 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 Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED Message-ID: 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> <98f9ff35-5d71-4706-afe1-7e039afbcaaf@paulmck-laptop> <05066f9d-b8c9-4a22-b573-928df4263e49@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05066f9d-b8c9-4a22-b573-928df4263e49@kernel.org> 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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 10:08:24 -0700 (PDT) On Thu, Oct 19, 2023 at 02:37:23PM +0200, Daniel Bristot de Oliveira wrote: > On 10/18/23 20:13, Paul E. McKenney wrote: > > 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. > > Sorry for the delay, this thread is quite long (and I admit I should be paying > attention to it). > > It seems that you both figure it out without me anyways. This piece of > code is preemptive unless a config is set to disable irq or preemption (as > steven mentioned). That call is just a ping to RCU to say that things > are fine. > > So Steven's suggestion should work. Very good! > >>>>> 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. ;-) > > It works for me, keep in the loop for the patches and I can test and > adjust osnoise accordingly. osnoise should not be a reason to block more > important things like this patch set, and we can find a way out in > the osnoise tracer side. (I might need an assistance from rcu > people, but I know I can count on them :-). For good or for bad, we will be here. ;-) Thanx, Paul