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 0496ECDB465 for ; Thu, 19 Oct 2023 12:37:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 588108D01A1; Thu, 19 Oct 2023 08:37:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5112E8D019E; Thu, 19 Oct 2023 08:37:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B23F8D01A1; Thu, 19 Oct 2023 08:37:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 24B008D019E for ; Thu, 19 Oct 2023 08:37:36 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EAC98140397 for ; Thu, 19 Oct 2023 12:37:35 +0000 (UTC) X-FDA: 81362162070.02.5280201 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf15.hostedemail.com (Postfix) with ESMTP id 0C38AA001C for ; Thu, 19 Oct 2023 12:37:33 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=k9YWca4Z; spf=pass (imf15.hostedemail.com: domain of bristot@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=bristot@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697719054; h=from:from:sender: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=82TY5YmatflifGFDJl3YgHb3p+aqO1SkkYeWp7yGk5I=; b=QDMQZM3nQY301pSN2ypFbTwwAzUZ6iqZAJWtQzZ531W/QMnYW2WDyEWzviDtXcjqsUuqf2 Q3U19EsgCd+wze1FmcR0NdfHEgPMORu63EVIt+DBUH2KEWpFRLBoxMgLHe+ujOkPeJLY73 4f0UGtrmmj1/5O4/Ch26UeJ7tckxME8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697719054; a=rsa-sha256; cv=none; b=vadCUHnbsnQdosvW3Qw6NUIxpmABso27mF5WumhH8MgyWoZjK+A2pI7/a14FyHRR0lwY6N 3oaMgbE7k/43snnXi4W0JijdBeFl1xBqhaxI2RhPP3GYYzBanXTovzLIJEB+C6W+lp7nAd Qt7cAZt/INondec29e/emTSflIgd9JM= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=k9YWca4Z; spf=pass (imf15.hostedemail.com: domain of bristot@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=bristot@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 1A344B82776; Thu, 19 Oct 2023 12:37:32 +0000 (UTC) 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-Stat-Signature: 6cn8icxbeterdjfo464pqm6grn54au1y X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 0C38AA001C X-Rspam-User: X-HE-Tag: 1697719053-383166 X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Va44/swwd70+GBRTGnDNTnxvJLIVYXtOLRf9DRSKY/rcDYCPmizywlDl5BVCOxRnohgY1X7ScAdHMrml4w/jkNVrjHVifr05/VuT597DLMfYiBr+CWfuncYq39DFxTKXphgBGm8X+Fl7MTU41YTTZf5D99AUXRm33LqhwxCnQO2Y8RX42zuyKo3Yhp+x3gid61pkhC/8if0QNM0G5UR9L1gfOgrJMbZuGsaxJSmONmpKUYmQ8yvG2MbdI7ofuDkdrC0= 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 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