Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp316675rdb; Thu, 19 Oct 2023 05:37:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6zujcoFOqYk9iVV+PCmk/wP1Ue+W3OLlFC7RarJoffEbbQPvCbROXML/nOClaljDmaFB4 X-Received: by 2002:a05:6359:5ea0:b0:166:d5a9:97a2 with SMTP id px32-20020a0563595ea000b00166d5a997a2mr1913371rwb.24.1697719064149; Thu, 19 Oct 2023 05:37:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697719064; cv=none; d=google.com; s=arc-20160816; b=ASlYafg44nxKISEarP1dtNuCui7p45orfkloiRTVZ3bRdftdPDlTPify03GdOYbUbs H/YcPlGAZ7eO71rJPDH2CjXsOuV5z+lcYowFC82DswJCl6J10lEscYDdCMxBIEsPsUXO 7ijCe+PPEVwVuUAwMHdIf9qYMqdhIWir3Y7STCeS7VvvXBuII5PukU7TNpi4UNxy8R8H 9MTya+GzoChDf4jqIS9fMGrm+6937oH95u93JhrHcmVCxK0l/rJuPTVX8wPe9peJeoPo qYotzrMMZ9WxMsQ+yfKyRaA/qbY0DMF4yIR9EKRAfNgSQUpI06s80D60WW3IWJcm6630 BTBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=82TY5YmatflifGFDJl3YgHb3p+aqO1SkkYeWp7yGk5I=; fh=sY/39YetznO8qWr8C7ufCA6GdtNjRUUZmMxwl1yCkAk=; b=wV5bRlZ2qf24OfvEKVd2+znniV09soiMHX/3SO4jxzNySJ7O/T2n89MEj30oR6bVhv uFcvYkbpdNcSBK/tGKCfgCzM4jKdSdug5rP1aMfEaEept8fCNMD81o7lOPwZ/jTkzsvJ 4n1Rq3MD2U2fbYkqZk+HNafw7XAiL6tgIZlYdFK2EIMsDzMKLaUp8Q44w+//hcy+DwDU xbgBqxaOREy8AC62zZFLy3SsWnQMeDaGKrBiSxsr+9c9USwXN48cbc3HT0cmXesQQVvY DwlMnPTxAdEdD8qCjND0e+n84fDnWuPbHF2OfaYj8Mp+/QZn/P6bQPFOYpCdF77VfIad OhnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k9YWca4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id q8-20020aa78428000000b006be1dd2313asi6055037pfn.210.2023.10.19.05.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:37:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k9YWca4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id CEDB880557CE; Thu, 19 Oct 2023 05:37:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345495AbjJSMhe (ORCPT + 99 others); Thu, 19 Oct 2023 08:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233204AbjJSMhd (ORCPT ); Thu, 19 Oct 2023 08:37:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B3ED91 for ; Thu, 19 Oct 2023 05:37:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 046C4C433C8; Thu, 19 Oct 2023 12:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697719051; bh=+6WjsLik/mT7DRZ52304GX0OlGSRTcYphDgt+xJktvo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=k9YWca4ZBzrXC+Kbyx7KSVfQOfqUeAVC6E8O2jFODDW5jsYDYuQHIr2yQs64Fb/sp 9W+xQiQuby6F1GzQ/qVZ12WHjF9/zsfsfqWlLPSNHnq/iX+Ykr5tTewg1lGPyzrncE A3iKkr5jtnp6i2Vi86VEWGg4+nBxMM47qBYH0dcteiL3dYrwYGmmaDNHE7xHs54jtX IUdhBT5pGlwk5qoLMavvdw3ZBOD+hFjanB5gH7l5Kk7vnmNGYX1J4Msc89py0KLr4f EStwd7oa4c4jKnqLHYGnJS4ztTfIcfsaghF0366QyW3gjUlefuLvKlmuaJtul5Zn7E Lsp9UMZmXK8eQ== Message-ID: <05066f9d-b8c9-4a22-b573-928df4263e49@kernel.org> Date: Thu, 19 Oct 2023 14:37:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED To: paulmck@kernel.org, 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 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> Content-Language: en-US, pt-BR, it-IT From: Daniel Bristot de Oliveira In-Reply-To: <98f9ff35-5d71-4706-afe1-7e039afbcaaf@paulmck-laptop> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 fry.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 (fry.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:37:42 -0700 (PDT) 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. >>>>> 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 :-). Thanks! -- Daniel > Thanx, Paul