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 8DAF0CDB47E for ; Wed, 18 Oct 2023 17:55:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 288DD8D0175; Wed, 18 Oct 2023 13:55:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 238E78D0016; Wed, 18 Oct 2023 13:55:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 101878D0175; Wed, 18 Oct 2023 13:55:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 019BB8D0016 for ; Wed, 18 Oct 2023 13:55:09 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B7342B5EE4 for ; Wed, 18 Oct 2023 17:55:09 +0000 (UTC) X-FDA: 81359333538.20.49E3E0E Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf14.hostedemail.com (Postfix) with ESMTP id 5D9F4100037 for ; Wed, 18 Oct 2023 17:55:06 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=B8PKYxWI; spf=pass (imf14.hostedemail.com: domain of "SRS0=oRJs=GA=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=oRJs=GA=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org"; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697651708; a=rsa-sha256; cv=none; b=vz1f+1tDDkccPiTX7W0xj9pbDJgsi9hYeWRcnYli/PfF7uRyrOlWY4iREvc7uKmMU4QBOt WcIlWuh4BjZRCnZjiGb9dBmBCH+uZuGjVrxH8/PSpPfbj+mfTOdAMY2mAe6/evhPq7+SQm bplXm9+xaxBXHHXqlzP3T5Va768OgH4= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=B8PKYxWI; spf=pass (imf14.hostedemail.com: domain of "SRS0=oRJs=GA=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=oRJs=GA=paulmck-ThinkPad-P17-Gen-1.home=paulmck@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=1697651708; 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=K9Lj9OYcnZjZhHlu9ykbpZjxDBTCHO21NWDeOCtijF0=; b=b5Efg0SQOKAPGDpNlydl7XdR1yMwHdWnP4SWfq+4ykIESvRqKUjfG+TCwXDRAV9iDFNvkI fKh7pwO57Y1YNBUIfeO5zLHA3gDBrnS7PGkcpH4p0ztcj4eYD76bLj7BFoxDwNHiYsLGn2 9n67YT3pGyDB97VlAS2JFnx2IN6pfE8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3BDD4CE267D; Wed, 18 Oct 2023 17:55:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BFEAC433C8; Wed, 18 Oct 2023 17:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697651703; bh=y11GmPUioTTsJkproZ9v5w2ZavV7U/e6HoyPkjTkXGk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=B8PKYxWIDVi5wbmumEgOqxlemNvx24AxrJawiyQh8vo/kTyoTZjcxq+QytyeGp308 zuoFkJpP2fYEgYvzRWTtxs/u1NQ2v/99hn22L9rl4P4eIfHmoufDrqVSD7bMfszSiR iMV2bFKwOFcA4y53W3ETa6jbMlbOje+kM0GHPdYpxyRwQDCMCvHQAf/nxEXPz86gPw TAMmVpRPY+wcbJm162nkhdtToKT9d79hlAp+Co4wQjDnPNbVzWByrXree/Nuey5IZV 86GIuLPc6IvXX78hQHg//+dwLNR775j4GGS/6v/7PCmwQxgEvJ/w4FsnUdVzC1X/s8 dfAB0aF5DQWTw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id F26CECE0DE3; Wed, 18 Oct 2023 10:55:02 -0700 (PDT) Date: Wed, 18 Oct 2023 10:55:02 -0700 From: "Paul E. McKenney" To: 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 , Daniel Bristot de Oliveira 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231018103146.4856caa8@gandalf.local.home> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 5D9F4100037 X-Stat-Signature: 1go8dzw13o3jacafhwu9eqt8yermjjhh X-Rspam-User: X-HE-Tag: 1697651706-506775 X-HE-Meta: U2FsdGVkX193MakKjQiqI+vrSahwBn2QJihXn32wqOTNywQlXjEr33fygu7rcFk8kqFCj9zXXwsEhZ04FaiQB3vXqVRkIFxmdI8cITXanEKPxppzGVeguMXnRGuPUp0gXA54fRdR2itG811HogfFGsoB92RBShotia46CVKIegFkiNWo+F3ftEZMjJqTE7tCeLX6V8d6jTgUinYAlRFgJ+oj88WONinD9DKx3rVr8HrNaJSwTv2InlvjxeX5rNDrVfg9UikuW9/HJ3nvper+Xkc9apuqdmzVFZaTMdhC+QMwNBd49JKRPn+Mh6RDpC0Hp5UhzzqaawdJDFpZEWLQpguUvKzIUYfXiL9zoLVDOhSTc1E5Z78mt0SBS77ySgt9IvI1+3wZolV6abuHC8e+vLkE1IVwB6hI42E93Hipv2EX2eIsDJZCEKoBB5Cak4xNpHeS1kXHgYvpz8iMCI5c1U4NZ8ro+Z/I7e4Xnng5G3FpRWqX2IBgBFljzXwL3Y+Akg+bVEvFVJgIK0SYZLgo7cxvrKE96QHcFswiQ64wsDEaXEmUrplYN880bsbrwpSMwLb5QUbawvIgWlDS0q8vWIj+VcfUmeKM9sGR5eEzIwSDIU2mSCGJGnSejK7wmMMe3VAhE4fGo0GCxRXAjPjPBGnFGNLh/bKX4V02l0Da7/wnGkFfLCzx0ZL6GZaoIlr3zbvKnyR28+0eEV8l7HGrOb2IpGuAXsSA+LL+0au87QiS6cOolvLcNpOb3oo3TIcPvx2+FGmW5OsKeZ+qWc4OiG23nWWXEcm7GNrOihqL6nNG8WEa7+0oZ3RE0FCCnYbkS+3Xm7B3h0gtiO9Y9K7LSv591Yh+yxQXScSbGklZ8+w3Y28ej6frebdVpTyWaiJR+kn/f4vlTo844Ed+FRo123pkHmeDh+P0VZUv780/r6kGFaPo2uqrPLMFRNwUTOUbRVQ3DOrPnrtGXSIAz0k kmEuqjHI EZFOSQax/lQh1sm8hy3gHocTvtT3OKyq1BTa4nVI49xcjjsbb9rk8GbDqCGE83ebHE7SDVPfBnsiBXNE6Ybc6LZTdtHu4SDwQnXsG6IOxXsubK2r1fK6B7s7zGjW+CpkWh3mpk+94DtpKdnwoiufzip5J8H1aWlCVA/3cYrvAfPkcxaUMdpmgzu6t3QF8AoHHNZptTojx01kdpvXL6hBRQFHV1+s75nvbfPOjkAPiJ8O4gpfI3Ret6KP6esNodTUELFvhZ5Lzed1z1IYG5gURA+iEiBFCAKq6d8DBpJrDAY39JB5mF2YPmdtYXB0xKMqrJ6WAl1xYbpMUX3nUCBLM0KSg8EjmoaGjcBOrrjFWg+cbKPRdtdsZP4rMWRzq0Al5QANiW4QHPCMFiys9E8ik+HRqVKnTp4SD7TGYAl3YvEBZmdQAoKpc2PLLpFQyGy3rMGXIeDIGwNwEmQ+r290xp9oT2M51yOsMl4LFJqv8XXW4FZIv8F5ehHMe7vFRSU1QEeqztVxMRBfBhHkktltdTuSVstm5O/nRvjeBEPHxNa9BaHmFjS/5/AXNxJtF5EOrRsqbxn+5lM6du7Q= 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, Oct 18, 2023 at 10:31:46AM -0400, Steven Rostedt wrote: > 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(); > } That is indeed the place! > /* > * 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. 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. > > 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. ;-) Thanx, Paul