Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5633167rwp; Mon, 17 Jul 2023 07:15:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlE08xb8S45LQzs8B0mwLTT84mrM8HD+D+ruPFKmLkkBAY8Bxz1sdaTrIrFvZtaD+qlc9cgf X-Received: by 2002:a05:6a00:13a0:b0:66f:913a:7c1c with SMTP id t32-20020a056a0013a000b0066f913a7c1cmr15749731pfg.22.1689603338734; Mon, 17 Jul 2023 07:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689603338; cv=none; d=google.com; s=arc-20160816; b=XTe4sbbdlW50aAYsKwy7K88CLg+wQb/xzCfklvTP6D1bcRJ0fvCD9g/Mdjbr+p21M4 s4CLWOygWUbSDlijNtgCGeujox06QCs9GMzdf7d2nucPMNHXRbupLxu0HbXUIzhxl/vR 80WIZE98bNz4oL5zgI++5Md3U6+dn7ueJYl+aIJu57ghYc9UC/Emz/DRQVmo4llaA7Wz b7FwHzb2kERlJ/pscRcvdHACgiG9Yf5a6n1h5JZQw+6r4iSq+YQe1o7yKTO/sE1AmAL9 b+qNfFCFcUUi3+k+oGxetvto71NpKxfYs7H2f5Kv19OdNSkr6gPKas4Ze0/iiQfFIN3I GB6g== 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=533J8q09bdBVgsSwgi5fjA/3C2Ga+QfLswMcOtH+Swk=; fh=nsojocMdPzSlPp+x6/ZxaJPadhfblHxW7pmZmXmognY=; b=cHXhLGfV+dvfULDhV+t4qzfPl9F2DDed2yq6Mutjj8TBGiMauUsjxUm/RU8zUF7SQP DtQaPqsxDFa//7E+BQFaY/VvB80qyijwJYVyjQdmoiQ7mAG+ykhom3UsDEToJDxRV0z3 CzGDil7rY46qlM01XhHzUoNrXsDnHxki/s7+jC3dwExH+3cJczm3VDTDl0w/JTteu/S3 t/GnGzc711Gyk/tZ4BGMjxyU4GDWApvf+zS++XYfuZtZ8nvRYPQsHmM94SyKwt/1vm7i OZEf/RVd4+oXYSG32vkc1uAYNAk2QtF778zl0ZBez9TB/vOBGnAuKyvJShQyQkJKsyUR TGcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mjiuohBc; 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 cw25-20020a056a00451900b0066716dc50a1si11581687pfb.179.2023.07.17.07.15.26; Mon, 17 Jul 2023 07:15:38 -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=mjiuohBc; 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 S229923AbjGQNiI (ORCPT + 99 others); Mon, 17 Jul 2023 09:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbjGQNh6 (ORCPT ); Mon, 17 Jul 2023 09:37:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 996658F for ; Mon, 17 Jul 2023 06:37:57 -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=533J8q09bdBVgsSwgi5fjA/3C2Ga+QfLswMcOtH+Swk=; b=mjiuohBcL19EX4pyeKTYv2DSgT zZMpUgEltG9nwunrNMkKpw1yvMFX3pMpLy/2/o6AKYNfMq9hTTvbAYxjjTFGJXsiBog3nRpdQNt7Z FSAHmnkyZtnIEI71h5yG0r89OHRYLQNpphbpD3qlmccWlln8yjzgIsOU5JuhpE6wR8gk/owbkvBla +LRUSsSbNu4+UUJQGlC3RK6ufIqwY0yl9U+6JBPzKRdFHvqAIy9bpzJhgqOpvUVXjemfPHRdqFgFK RybXTt4g8o4ulAIEgNd+qBF4uc9gktjq7Dx5qvNwxTzISOpMNZH+uroEcQ4pjdr46oBgUXAxanxpE VJ4TUFcg==; 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 1qLOPh-003x82-HK; Mon, 17 Jul 2023 13:37:21 +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 E6D1630019C; Mon, 17 Jul 2023 15:37:18 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C41AF24BB537A; Mon, 17 Jul 2023 15:37:18 +0200 (CEST) Date: Mon, 17 Jul 2023 15:37:18 +0200 From: Peter Zijlstra To: Shrikanth Hegde Cc: Tim Chen , Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V . Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J . Wysocki" , Srinivas Pandruvada , Steven Rostedt , Valentin Schneider , Ionela Voinescu , x86@kernel.org, linux-kernel@vger.kernel.org, Srikar Dronamraju , naveen.n.rao@linux.vnet.ibm.com, Yicong Yang , Barry Song , Chen Yu , Hillf Danton Subject: Re: [Patch v3 1/6] sched/fair: Determine active load balance for SMT sched groups Message-ID: <20230717133718.GJ4253@hirez.programming.kicks-ass.net> References: <165778ce-7b8f-1966-af02-90ef481455b9@linux.vnet.ibm.com> <05ed4537-e79b-0ff3-5be5-92cbffaab3ee@linux.vnet.ibm.com> <20230717111053.GI4253@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 17, 2023 at 05:48:02PM +0530, Shrikanth Hegde wrote: > Hi Peter. > > Sending on behalf of tim. I have included my suggestion as well. Hope > that's ok. Please find below the patch as of now. it includes the > couple of changes that are discussed. (in 1/6 and in 3/6) Could you please add a Changelog and SoB thingies such that I can apply the thing? Given Tim is on holidays, perhaps do something like: Originally-by: Tim Chen <...> After all, you did some changes and verified it actually works etc.. > --- > kernel/sched/fair.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 932e7b78894a..9502013abe33 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9532,7 +9532,7 @@ static inline long sibling_imbalance(struct lb_env *env, > imbalance /= ncores_local + ncores_busiest; > > /* Take advantage of resource in an empty sched group */ > - if (imbalance == 0 && local->sum_nr_running == 0 && > + if (imbalance <= 1 && local->sum_nr_running == 0 && > busiest->sum_nr_running > 1) > imbalance = 2; > > @@ -9720,6 +9720,17 @@ static bool update_sd_pick_busiest(struct lb_env *env, > break; > > case group_smt_balance: > + /* no idle cpus on both groups handled by group_fully_busy below */ > + if (sgs->idle_cpus != 0 || busiest->idle_cpus != 0) { > + if (sgs->idle_cpus > busiest->idle_cpus) > + return false; > + if (sgs->idle_cpus < busiest->idle_cpus) > + return true; > + if (sgs->sum_nr_running <= busiest->sum_nr_running) > + return false; > + } > + break; > + > case group_fully_busy: > /* > * Select the fully busy group with highest avg_load. In > -- > 2.31.1