Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36587773rwd; Tue, 11 Jul 2023 03:04:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHpVfQbOPMbHd2ELmwF3eyRylFyP8mb6iHdnfwIwAbBzgydvZ4jyRSbP85sBEa3i4V9UMcl X-Received: by 2002:a2e:90c5:0:b0:2b6:eddf:d1e3 with SMTP id o5-20020a2e90c5000000b002b6eddfd1e3mr10537456ljg.40.1689069872028; Tue, 11 Jul 2023 03:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689069871; cv=none; d=google.com; s=arc-20160816; b=yPJEFZzBkoPEnLCzAyTX6nSvjvgb8xSSs8hirZaTXov+bEFSXHrFXj30Qi3YAiaRkA MsWVybSaMxKUkZP6JfIJFXWlf/TOVTBakhkW5RY8FaJn2Eqp6rfc9DumBoUqx0qP6pV1 UVgKOAyZdCeMIdKoUi2lyccfPUIn0omCbKdROJtrukarFJWFWAcs0oTUckDXzh6hwz94 s/e2+OooJ73dWFXZ77LWRr8IdfzCIs2SbDKaDptXPxZZReaET+hKD3S+q6sMt/M+mflT W9wzcLyadlvq1P/IfoB9xoj2ox/4sV1Uzjc3vrLMjA8k1/auoOSqFuLXAy1obGidhCRW 6mrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zpa+DwUgXhfw23ATtzr9y8HfeT093YZc/Ka29TN/0Wk=; fh=oxPhYVaH3K6dRoBQR5dvft4TeBFawrKdpu+R4/k58+U=; b=JyczNdhQOLJX2uwc8HVuNWdLV49vSCc9u25NcGmmuffr23SttXN19stetEvcmh9BNF T49vlWfG9NGut9/AOucx3a0jTcaRwnVlmztMvFqDJn0ApjLrAHZkApD/J0epsvAkNbqz 16LQdURwtLVr3+vp7aRWUm77Oy1rhRT6JmqHzoKflJYHeGkAtSQ2B4D+wMfN95mAxCc1 OgcF4iwC237dIobxYEWHMCypYRaEiI1QhMgwAjtGY6PgXNonOHhTuFZ0SnZLyiAtIR7U 7UFg2PEctRy32jcJ3CC+snKTxkka8F9gxVaKvy91kwC1dSdH3YNPeGueN7+ck+LR6iwl OxgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EilLBq57; 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 lw14-20020a170906bcce00b00991c8af7ba5si1832445ejb.473.2023.07.11.03.04.07; Tue, 11 Jul 2023 03:04:31 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EilLBq57; 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 S231349AbjGKJqY (ORCPT + 99 others); Tue, 11 Jul 2023 05:46:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231201AbjGKJqW (ORCPT ); Tue, 11 Jul 2023 05:46:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0F07A1 for ; Tue, 11 Jul 2023 02:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zpa+DwUgXhfw23ATtzr9y8HfeT093YZc/Ka29TN/0Wk=; b=EilLBq57mEejxsVUVLHBms8YGC H8cQXR4SkYlcjQ09cwk5Kb1gxld3j1/3J1QdsQRmqp/QYMbJl3iZpJuIinUHwqafmbIt/lmqMVfIg gTPe8K9mPBm8qajsDjcZJJhYDPqggCOAK5PcD5H7gtFdQXqGi5ej2eL3Rq4L3qIDzbQhVXq1vF253 wp/4oCVEdIdR4fXbU5tGecMtKrlno53zcnzdwiFqZa/+MuIux3TYL0e9FHM4sz0LehZyoDAp/nyxm Vyp0/T9NtQsaNCDB2iBtqSYSciKDBneDx0jjm3phkoNTdUNeqM2LgKupwg3cNB6EIcA9NKUk5h/Eu ei+n3eWQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qJ9wL-00Fb1p-NT; Tue, 11 Jul 2023 09:45:49 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9CA39300155; Tue, 11 Jul 2023 11:45:47 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7E822240EBDB4; Tue, 11 Jul 2023 11:45:47 +0200 (CEST) Date: Tue, 11 Jul 2023 11:45:47 +0200 From: Peter Zijlstra To: David Vernet 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: <20230711094547.GE3062772@hirez.programming.kicks-ass.net> References: <20230710200342.358255-1-void@manifault.com> <20230710200342.358255-5-void@manifault.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230710200342.358255-5-void@manifault.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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; } 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?