Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3841188rdg; Wed, 18 Oct 2023 07:34:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQwCbH53vP3HG2M5mR+leoNdzGnl5tMomXRETjAK8uvAQUm71n2+WjbM2njB5jpeO3/XiP X-Received: by 2002:a05:6a00:2285:b0:6bd:71e3:b647 with SMTP id f5-20020a056a00228500b006bd71e3b647mr5279382pfe.19.1697639669441; Wed, 18 Oct 2023 07:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697639669; cv=none; d=google.com; s=arc-20160816; b=hbVLCvZv2ohl4F9QuUTVA+uquliQN6SpgcXoMq8bDWznBPnuov9KrzxFbs5iyi/2uA XdJ9bsrJUE7opzzcuFVYF9rrQnWvT2MnHLC6H3gegZVa9awpH4lX9hCAcgkp7Cv4ieVw 9SMs5HTR9NXjKewUJrProQQZat3zVhjgelvroNE9Z2rEtnNdIZAobI8a2WvGJYUx2m8u JwQhHnFP/o55VxPntEZAHoU7USBqUUlvDUFWagV91nSvYHTbWPuKRjnlZUwTiVo5ZCZD dU2zA6uaovVA+6YtRtx5NRji5aGQtGb+E2JNbyPOk0tqxabTLjEqtDCIx0LOiS0jLaEL pAYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=v6/iO1zJ1ty/Mi+K+rKs2ovE1RgST5Gk0thJPgI9PQM=; fh=LFK9lHvqz0kYX+3ATfgxmIYpqRdn+gJuAEnAfxrivAg=; b=csvxLrAj1bAzz7E6MLK9RaeGlOARECc5bBc3+Y1pOYFADENl1BtBKjFDqpOj5mhs5W jkpdo7zFv1PY+FMOz4jSmedBy3QTAs4BsAbuV7Mn7BfHo02OYyg4JlYCed+SzbwcnQui fWLnX8sk2N9dx/oMj0IgAZuXv6XLf1s91UOYhNW3tb/cVHQbFj9JqQX8hTVsszTvYIgW hHx7G7QPqWtgk7F0qlMxCojP5VDoxzzIwwKeqy58+ObNao1pgjCZQhB0nSyJjGubx+5u VDe2nLxI5I4+jJW28ZnAEekwDawKBspUQ6Hl1j6H9HZZPNmJwuSg79iKkKCeWCrHBf+q 3McA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id g2-20020a056a0023c200b006be01b51af8si4291502pfc.33.2023.10.18.07.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 07:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5A44D802389D; Wed, 18 Oct 2023 07:34:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345712AbjJROds (ORCPT + 99 others); Wed, 18 Oct 2023 10:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235255AbjJROdh (ORCPT ); Wed, 18 Oct 2023 10:33:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3DEC19A8 for ; Wed, 18 Oct 2023 07:30:10 -0700 (PDT) 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-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 07:34:26 -0700 (PDT) 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