Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3963863rdg; Wed, 18 Oct 2023 10:41:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLA0FoOPxwdfgDyJ0JLBOO4PS74/YJELLn5JDflqbfwyGS+BzZndeao1tyUDJ7DSMrzDoP X-Received: by 2002:a17:902:c653:b0:1ca:7086:60f7 with SMTP id s19-20020a170902c65300b001ca708660f7mr39488pls.28.1697650889506; Wed, 18 Oct 2023 10:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697650889; cv=none; d=google.com; s=arc-20160816; b=vFp1EUUuaB3o/9ocWFYmyiNu4Sgpeh7+nNidV5nfWxENCJ8oS6MwryzBs9kNvNsHiR z8Wg1u4u5bmrX45V4DIsvQrQ/jZWxikE91cX5L2H9Jr25Y4TXcTgcqwKTzqAsTkMd0nK 97H0sFpUeOYgXg/i08louS/EN7DCc/xHweP7E09SN/2avSQTecp3JwSkH+1EjsdI/zNO vPhfPsf4mNCbVdk/MTO8rQEOipraI4nTQ/81dAeL5vldWjYC1BSXlBwtYENbLVnr3vuF bVC6E/yt414KOoN7cAKqVSQrI6GNMe9PiYnCP4u0oAB2wtmpQmikUcc9iV9p9Bp1SSaC iOtg== 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=F4/Uq8vkGDUl/fsie744LijKkURhPyJqG0jzyJJ7yCQ=; fh=92B+EpNdkYucRxAMYpsRouf5d/cSeqoQwu3swnjOeeI=; b=zEAp9DbaO2QmnY8H8SRibD3+JdPL5XuzisON+rn4xAgEoL0jCMJWIo4fuKjLFaVyPt CtQY9BsjrONp8KlRuH8KzqRTEu1taud7PGS0gAnpw4bR1j+Tm9MSJ2uvQRx2ih4FaQIl UWhIl8tLh7TPX+VFiGzdFjlL4PVOPApnsPq3oFnVusd/ApRQGiy7gVVX+m5jkGzCVP8D 24TIdxTIRuytAfvMXQyCshTOh4RjgRWQzO7vKADztaVP/XhCCrv0unV6hpAtsHjaOoHJ XdPBvVesaziXL/8+NcYjKxCg+UjqftXpcAQO52NIm0DHJmLCdtMxf+twRPtXaMrjaVYm OWDQ== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o12-20020a170902bccc00b001bbad1883d5si311665pls.293.2023.10.18.10.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 334F48076E48; Wed, 18 Oct 2023 10:41:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbjJRRlQ (ORCPT + 99 others); Wed, 18 Oct 2023 13:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbjJRRlO (ORCPT ); Wed, 18 Oct 2023 13:41:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8617AB0 for ; Wed, 18 Oct 2023 10:41:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D0DEC433C8; Wed, 18 Oct 2023 17:41:09 +0000 (UTC) Date: Wed, 18 Oct 2023 13:41:07 -0400 From: Steven Rostedt To: "Paul E. McKenney" 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 Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED Message-ID: <20231018134107.1941dcf5@gandalf.local.home> In-Reply-To: <61bb51f7-99ed-45bf-8c3e-f1d65137c894@paulmck-laptop> References: <87ttrngmq0.ffs@tglx> <87jzshhexi.ffs@tglx> <87pm1c3wbn.ffs@tglx> <61bb51f7-99ed-45bf-8c3e-f1d65137c894@paulmck-laptop> 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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:41:26 -0700 (PDT) On Wed, 18 Oct 2023 10:19:53 -0700 "Paul E. McKenney" wrote: > > Isn't rcu_read_lock() defined as preempt_disable() and rcu_read_unlock() > as preempt_enable() in this approach? I certainly hope so, as RCU > priority boosting would be a most unwelcome addition to many datacenter > workloads. > > > With this approach the kernel is by definition fully preemptible, which > > means means rcu_read_lock() is preemptible too. That's pretty much the > > same situation as with PREEMPT_DYNAMIC. > > Please, just no!!! Note, when I first read Thomas's proposal, I figured that Paul would no longer get to brag that: "In CONFIG_PREEMPT_NONE, rcu_read_lock() and rcu_read_unlock() are simply nops!" But instead, they would be: static void rcu_read_lock(void) { preempt_disable(); } static void rcu_read_unlock(void) { preempt_enable(); } as it was mentioned that today's preempt_disable() is fast and not an issue like it was in older kernels. That would mean that there will still be a "non preempt" version of RCU. As the preempt version of RCU adds a lot more logic when scheduling out in an RCU critical section, that I can envision not all workloads would want around. Adding "preempt_disable()" is now low overhead, but adding the RCU logic to handle preemption isn't as lightweight as that. Not to mention the logic to boost those threads that were preempted and being starved for some time. > > > 6. You might think that RCU Tasks (as opposed to RCU Tasks Trace > > > or RCU Tasks Rude) would need those pesky cond_resched() calls > > > to stick around. The reason is that RCU Tasks readers are ended > > > only by voluntary context switches. This means that although a > > > preemptible infinite loop in the kernel won't inconvenience a > > > real-time task (nor an non-real-time task for all that long), > > > and won't delay grace periods for the other flavors of RCU, > > > it would indefinitely delay an RCU Tasks grace period. > > > > > > However, RCU Tasks grace periods seem to be finite in preemptible > > > kernels today, so they should remain finite in limited-preemptible > > > kernels tomorrow. Famous last words... > > > > That's an issue which you have today with preempt FULL, right? So if it > > turns out to be a problem then it's not a problem of the new model. > > Agreed, and hence my last three lines of text above. Plus the guy who > requested RCU Tasks said that it was OK for its grace periods to take > a long time, and I am holding Steven Rostedt to that. ;-) Matters what your definition of "long time" is ;-) -- Steve