Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37126925rwd; Tue, 11 Jul 2023 09:46:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/+lxLcfLPBn69JA9Yw9AK7s0Xb/465bTl+Zf+rBu9NaOrp4WRiAfC9YTXGLyYhrDgNgZs X-Received: by 2002:a05:6358:9307:b0:133:e286:9259 with SMTP id x7-20020a056358930700b00133e2869259mr13927044rwa.17.1689093960324; Tue, 11 Jul 2023 09:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689093960; cv=none; d=google.com; s=arc-20160816; b=J5V7yETek16ENgDVs/S+x1VyK3eETxRlNnAZobN6NtAuUreoaK6RDgIZOQkbwTLzEi yG4FkAaB9nNTearRag/vlZ+xjP6gVePqj/vFZVBBN7BBIZE2vNOsavkZFrs4Ye/iF8x1 bX9VQOPNGyllx5COyhBEU9NE915WIQRMrUT79FX0cASGkmgN193PLZ3/quPMQu7l5nG8 hr18UKn6gM5I5YHoDycT0+xSzyAMYNrf+iL3Xnio4cb54bLLQ2U9zlqDGSk8nr9tDPOD mUmiAr94/A4ZNJdbOSrozQvElZ478Fs7rYwERyaRRwdeGmVEtJH/gFwtd2ZRKZWH6gtM 85gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ywQ2j8L4AJMQA4P82Cjvo7hxI/Fw5jSDYjwiGIchlFE=; fh=5Vwx8zyR5NEbF/aEpxXBSRanQfNoZqnCDGdIuLp4Ldg=; b=soe8KZ9YVRQlhvk6OaQ6BlOrAXFc0oirqlk6KjsFQP48JQepMjqcHnVpIFi+Cdoh0o C0iM0gZQyrZ8Vx1Nk2Ut0N8d1Pu9kYrUVXvHnvj16TA1nr4UXsGMHsgg2/f2RlT4tp25 g6tdNuUviuv8d3D/XwotZl/KMmohXkBE6KtKMRcLXJ6aWWF/Hq26dZ1hn8jYASlrZNyd tZ8IwJUwj5IufmPvUaOesI1YMOmdJffk4xhLbE4OIFsrHJiIhLxxSl/BtRYtz2xwaG4a s6GgXwW3PbI+pyCCy5YcJ0DOGTsD3nExNSpH1VGnUC0lJbUI05ijrBZS6UiV/y/jWkLx yyBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h184-20020a6383c1000000b0051b48085aaasi1699993pge.858.2023.07.11.09.45.28; Tue, 11 Jul 2023 09:46:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233142AbjGKQU0 (ORCPT + 99 others); Tue, 11 Jul 2023 12:20:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232260AbjGKQUI (ORCPT ); Tue, 11 Jul 2023 12:20:08 -0400 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3453B8 for ; Tue, 11 Jul 2023 09:19:30 -0700 (PDT) Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-763a2e39b88so589587585a.1 for ; Tue, 11 Jul 2023 09:19:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689092370; x=1691684370; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ywQ2j8L4AJMQA4P82Cjvo7hxI/Fw5jSDYjwiGIchlFE=; b=Oq8Cca2GgRr6YtiG5i+ETG9mUlZGvL9I8y/KKlQa2Z+B8crawegXTePCAu93hduSSe 0NmrvqSSs4WwNW1K72csltAw/D3KaTLiueWw7QBJtmE3FqXwXbW/6l9tkByAPNP+lbVc RDXQDPQZDrh8u8gpkbJgWypBFcur5pdyVlNXcOCGX71tER96dUODPPWLJBcozz6UiOU+ TKMuyGk24od0derWhtTe8Dbwpzt+54HQCcng7PyexLNnZi5EArD8YToaBKWHCtnzHjp0 8y47b+wrArdzf0KsfMUyloJYMe4LnQyIEKT0QB9PO+31yRYyzPvfJvtSALiV4WKturdA BMSg== X-Gm-Message-State: ABy/qLYNRfjVZm/LwB7U8e0tvsVdNh611miOYVXQKnWwdKnWkS9MXsoS d6bDR7Lu0BwJl6yGzlUIxfw= X-Received: by 2002:ac8:5f13:0:b0:403:b395:b450 with SMTP id x19-20020ac85f13000000b00403b395b450mr5190305qta.2.1689092369563; Tue, 11 Jul 2023 09:19:29 -0700 (PDT) Received: from maniforge ([2620:10d:c091:400::5:1d49]) by smtp.gmail.com with ESMTPSA id b15-20020ac801cf000000b004037cd9bd40sm1249901qtg.15.2023.07.11.09.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 09:19:29 -0700 (PDT) Date: Tue, 11 Jul 2023 11:19:26 -0500 From: David Vernet To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, gautham.shenoy@amd.com, kprateek.nayak@amd.com, aaron.lu@intel.com, clm@meta.com, tj@kernel.org, roman.gushchin@linux.dev, kernel-team@meta.com Subject: Re: [PATCH v2 4/7] sched/fair: Add SHARED_RUNQ sched feature and skeleton calls Message-ID: <20230711161926.GA389526@maniforge> References: <20230710200342.358255-1-void@manifault.com> <20230710200342.358255-5-void@manifault.com> <20230711094547.GE3062772@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230711094547.GE3062772@hirez.programming.kicks-ass.net> User-Agent: Mutt/2.2.10 (2023-03-25) X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 11, 2023 at 11:45:47AM +0200, Peter Zijlstra wrote: > On Mon, Jul 10, 2023 at 03:03:39PM -0500, David Vernet wrote: > > > @@ -11843,6 +11871,9 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) > > if (!cpu_active(this_cpu)) > > return 0; > > > > + if (sched_feat(SHARED_RUNQ) && shared_runq_pick_next_task(this_rq, rf)) > > + return -1; > > + > > Next patch implements shared_runq_pick_next_task() with the same return > values as newidle_balance(), which would seem to suggest the following > instead: > > if (sched_feat(SHARED_RUNQ)) { > pulled_task = shared_runq_pick_next_task(this_rq, rf); > if (pulled_task) > return pulled_task; > } Yep, that's cleaner. > Additionally, I think we wants something like: > > sd = rcu_dereference_check_sched_domain(this_rq->sd); > if (sched_feat(SHARED_RUNQ)) { > ... /* see above */ > > sd = rcu_dereference(*this_cpu_ptr(&sd_llc)); > sd = sd->parent; > } > > to ensure we skip <=LLC domains, since those have already been covered > by this shiny new thing, no? Indeed, another nice optimization. I'll incorporate both of these into the next version.