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 8C451C41513 for ; Thu, 19 Oct 2023 17:08:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F9D08D01A9; Thu, 19 Oct 2023 13:08:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AC4C8D001A; Thu, 19 Oct 2023 13:08:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDB2F8D01A9; Thu, 19 Oct 2023 13:08:16 -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 DF1CB8D001A for ; Thu, 19 Oct 2023 13:08:16 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A4D7CC04FB for ; Thu, 19 Oct 2023 17:08:16 +0000 (UTC) X-FDA: 81362844192.20.AEB5294 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id C78C220032 for ; Thu, 19 Oct 2023 17:08:14 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pLjfFdKC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of "SRS0=FkDd=GB=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=FkDd=GB=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697735294; a=rsa-sha256; cv=none; b=7opAULF8txOdJn/0dAtFa/d+8lzWIF3htgnpFe9Tl9bUMUsdWAYV1U/Uq8SxXlrlDxt/ig yBKA+24BBIs7OCUolJDi9aOcJfnLm2cxztrK++pgZk563Yyzq7v6ahSdX8dI9ZTtzZ7vbM BSBXauzpOnbDdYlIwrpEaU446GqLLkY= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pLjfFdKC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of "SRS0=FkDd=GB=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=FkDd=GB=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=1697735294; 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=yvEz7/Odoy7XLIjoDZElFG3wrqx3BJ7NsYGoRRJfL+M=; b=AYLxNjxJawBZOrwMWr5webzYrL3LH3ttFeHPRmr92DLI7sv4x4zi7GSxaFyjJOawrjFGRA q+HGv/cmkoCQHeLOi+dgEI72Z0/4J2vE747t0cPC3pMpobL+RadZwU62vai2wppkoJPhsz vQuCa/r8+wlGVLvh+pGCNSxcNUq15TY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8407A617C1; Thu, 19 Oct 2023 17:08:13 +0000 (UTC) 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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: C78C220032 X-Stat-Signature: c3513r5gihzxhk8c8dciqnu7h33887io X-HE-Tag: 1697735294-641076 X-HE-Meta: U2FsdGVkX19QNtcKEEOD4ajH6KBUjcWyD8xGipMZdiNA7ydCNkZVPpcKaG16nrTDUzApKtOUyvDYC2mLJsu4027ybxuxUwNoqRN36XVJikUgm/88VZSo5aMeTKOLrgbaISXzjlZhksWorWbpOr4X6D2CMCTLVtc2oWW/DLhXsnBLiXvfUTOtyFq3XfIutDcZTiXl5QmOapHNDYEuThJkPWfTET6fhizZshf7W2mVPtX3fXxeZrt8ZglhyBsrTTiFnUhSDMGlOYtERFcsvczaNuX+eu8BISNCNMuIZCNVz/TH7KtXVyPyps/72VSnfeY5vPdBzUWZepIS5zhQmozPV+NnV2qzDDDefCOUgZt6q5Krv3d7PWrQUhkcl9niHJScbMRlTUegVM4C+tvQxEUzxsz7SZwRTlzflD1ODQAo9qcNk7nkoc+NjSeflpT19lDzh2rvEVZhLqV8j4lz7LV4dfAJolVVRo7UyLwV3sNsjf6E32Ww3b9TcNB6lZq9hytkFAXTZf+VtRgLw6lrkkZIAru1IT/OXvhT06ASyXNcDbJa0KFI3Sn4yPL+PbIdIIjtZL1JlFkwR5cZAfMKsy7Ar3ln3/0jBAvo7s/m+HhWQwUHKx06JFFl1LZ9TQx4Mp6nR6FA4nunOUXs3qyLuUaeCQzwq6dOjkhy8mQa3VCqiT8VULul25FhR+GeIziZO9R630Y4tnbieqj293CIDdmA5btc4E4qFLdUrW/RrRPm+HZ0tDt8unacZTvyXTWFwj2alFs85K5qiYlf7Vxkicxik7vezm7puO5PNN7nySAX3KybFIi9QyJW+1L5frry0XHIRBmntppuqDo9u6+556N6UQEFz7clRrfSrWjgVsfpi3hfpkj1dtGXRnzvKR4+Bypp06nHHf6CGmdURTHdEgr8eKUAFlxQfN6fwNXrIU8hymz7aFbSWjQU2Vu/EWInUvXPJ8i4RylYQvzw1RtXhd+ RWzLHTBH veDYVjYz12VYhYC9tf9HdMbLrMtIhnjuGLwrRSqF30f94PrwtmcDjpf5TA1bdnf1XK0LOG9shT0wuqFIpUImq1N+9r3FZdb+sx4ws4HGQmqEfF2Ga4XZWfaVjPa1dl5dKmb7eAD3Mnj2hrMLZSti7zN3A5BG8siB+xFa3/FrjCuzwKkFZP/vlQ+kAKaLGWqxmwmHJBpSdsx5LjFtlo3n5iAaL8qXtM0owR5tfaIJcdXwJv9199j1SSXzD0VIH6ZeEu9NYw3OziJiOt79qcgiD/WRlNj2ps+WkGkuTWoRT5Jiyiz6X0FvnsU3dBFuGI83HzGtcRdwv8k1tyiEu7qtfH5UyFWvY8HSNZALPKNP/CYdslUKQgDHk0jV+eWKfwyZkISNAbC9hcD4b42D5gKALpW/TjqUOc3RMywOVfjasz6apiQSQwytMDPKy5aAOKy5eh1bO9e+FQMLpX8fkdW6QtXFNGzZ5uG9j/g4hrxnOTDH6ITl4N+3lHAUWN+0QHnWRopUjgxzF/8X7Sic7MXUeIh/Y/SP9zwuBcrxOabefuiurZe657IHXN5FYHr2NswKiVvtO9YvTYI0f6k8quIQFckk8JTd+N74OBKh17qJtivMdz1nF2/XlR//zzcMC/cZoP3ENDkNLG/aQKDc= 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 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