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 D960ECDB482 for ; Wed, 18 Oct 2023 14:30:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 794318D015C; Wed, 18 Oct 2023 10:30:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 744598D0016; Wed, 18 Oct 2023 10:30:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63AC18D015C; Wed, 18 Oct 2023 10:30:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 536F18D0016 for ; Wed, 18 Oct 2023 10:30:15 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 15D61C0878 for ; Wed, 18 Oct 2023 14:30:15 +0000 (UTC) X-FDA: 81358817190.14.A3CEB83 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf27.hostedemail.com (Postfix) with ESMTP id 4481340022 for ; Wed, 18 Oct 2023 14:30:12 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of "SRS0=xY8f=GA=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=xY8f=GA=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697639412; 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; bh=v6/iO1zJ1ty/Mi+K+rKs2ovE1RgST5Gk0thJPgI9PQM=; b=kcZMBdrgNElAXV7Bkws4JjveL3/hKxApv0D8ErF1CbZ5Bpw3OP+R8wo7q6ntOAaggU1O2I 8686YyIiRQDJjO6+pAivA+9GyhThwhcjPz+j7ica08tbciAJtANbOzrEmA7rriOSMNI6rF WYmkqbPXKaSmg6VoSN7zKVI91W4Jees= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of "SRS0=xY8f=GA=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=xY8f=GA=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697639412; a=rsa-sha256; cv=none; b=LtmQShnVVy0tK5COjQbDsjVqDQoJHXtdDjImM9dNpEvh/IZ+ZjSXeOEpWnEkeOl37D2fAq rkQDtSNFWIEEpkecm6x6/XzkWFs1b8uavUhRFsrNjQCbkjuSGvPXKwrPArug9qP+EdPxto nRMrV00x07UresYeeSlgqu1fqRKwTPI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id B6BAEB8239F; Wed, 18 Oct 2023 14:30:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7317BC433C7; Wed, 18 Oct 2023 14:30:07 +0000 (UTC) Date: Wed, 18 Oct 2023 10:31:46 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: paulmck@kernel.org, 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: <20231018103146.4856caa8@gandalf.local.home> In-Reply-To: <87pm1c3wbn.ffs@tglx> References: <87ttrngmq0.ffs@tglx> <87jzshhexi.ffs@tglx> <87pm1c3wbn.ffs@tglx> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 4481340022 X-Stat-Signature: 5ro8djebhzudwt6w9rqn33pp8euoz1of X-HE-Tag: 1697639412-948374 X-HE-Meta: U2FsdGVkX1/CLR/2JnOOSsAFYDhr1qCCKI/3hCiPEM/RLBkzbrxU95tvEbkyGvD+ovEjSB3ApWo4Vg0m/uYbSs4PFaTbiE9AmWZ8Tx2IhterhrU+W3Jxnd/Yy9d1Bw/L8s0FHNRWeaaT8Ihf1r7GPy5He6o8LqyymyZ8vj28jXFIUCOp+Pkg4UwnjzvvzZkkXhtZr8OhZqHDvNHkITj2af9G3aeycQg+C4KLcJCbWqCbSpC37JgHlNG38vWEWuSqkFO5h8WiXlUSYLgRXjtkp47pnuVS+GeuBgaeJW/434G1GvJ7rPTYvJh/dN614ma/g1rhn1hOEscd6aXG73VxeodUs+T+H+ZnjsIC6XKHGvqoH48mVWUanh/UNADhv05ybFdjAEAdTO4mHdlSTNynEe67nCNheKd49FP9JUk0IdDE7/VsDdPbrDA1idJfMpkx9k+/CdUjZxmBIv+RIWDebfU6+jL9aJ2+mB/VR4pZPFpRUj137rG9FR8GRxPoIPcLpvgKmWDBnTkP7YZWViKWiKe7kJVr5lvd8GXjzb5SI2u0EC6O+aJS5QcFPV2yzjGHzkeSZI/+3dudgNjFKBK+m9Dvoofn7P+aGmALntr8l9Ap+ErA6UQxNoO85lNTwMEpkFURBQVLMjB2Vdi7LGvIXo4D1GzvkjPmYbQz+5lnB+Lh+wo8EYSBFiJoCcgaKHqc16wzHEcOIu6nuv3yHx0IXw6RrvPtcDe3lh5kZsdMEnc5v0yRwotkQfPBJhlijv2pM75fuwty4BTDMUIvHCWjzDS3YSIJdNniy8V/FK9Mp7FOCDGt+2Bs4M2iRDS3svAN01OInB6JhzzJldzfQc5dH7POYsUlmqCYruDOvui7fjsC4u0Yu6HqKkZUGSDxqgDW1U8gFnIyJT966r7VnlTRE4DDOEbG69XqOsx72Q8mEHYMtp8r7yuzuUXI3kAj/B+0lIgGzAQ8JCqoPEiNnFw bvIHHgnB VruQ2K4XiI7PjLnPyuKxYgwY5cDssmxfAV4onjyI2Kj/BNMHIPH+HATTBtwyVG7593TdSAlhDksENRgb8ckqlwYrA2obxWMHbuJjqTGlF0F5jaS6u4pYbVD84pXyNGrXafnWqLb8WJrxgyB4zBC1HGrGZfnblLSU/nwzbscFMIrLqJYxELe3mZ7SpnZK/23b02xCGacnxMYHknRGI8idA18s6DMxBjvBpzqHCoyIdqaRxvKT72xmEo6XiF52eDoMQpEBcYXkzEy74Nqx/erszX4ZG91OTtE8eDlhguaS4U+OXALo= 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 Wed, 18 Oct 2023 15:16:12 +0200 Thomas Gleixner wrote: > > 14. The kernel/trace/trace_osnoise.c file's run_osnoise() function > > might need to do something for non-preemptible RCU to make > > up for the lack of cond_resched() calls. Maybe just drop the > > "IS_ENABLED()" and execute the body of the current "if" statement > > unconditionally. Right. I'm guessing you are talking about this code: /* * In some cases, notably when running on a nohz_full CPU with * a stopped tick PREEMPT_RCU has no way to account for QSs. * This will eventually cause unwarranted noise as PREEMPT_RCU * will force preemption as the means of ending the current * grace period. We avoid this problem by calling * rcu_momentary_dyntick_idle(), which performs a zero duration * EQS allowing PREEMPT_RCU to end the current grace period. * This call shouldn't be wrapped inside an RCU critical * section. * * Note that in non PREEMPT_RCU kernels QSs are handled through * cond_resched() */ if (IS_ENABLED(CONFIG_PREEMPT_RCU)) { if (!disable_irq) local_irq_disable(); rcu_momentary_dyntick_idle(); if (!disable_irq) local_irq_enable(); } /* * For the non-preemptive kernel config: let threads runs, if * they so wish, unless set not do to so. */ if (!disable_irq && !disable_preemption) cond_resched(); 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. > > Again. There is no non-preemtible RCU with this model, unless I'm > missing something important here. Daniel? -- Steve