Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1577687rwr; Fri, 5 May 2023 16:58:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OqSnoGPVxFxf+KsXvI+/LcP43Vsxvv/I8qCV6AULS7tBI6Ckakg9MdH9GtnMvY23Tb1uR X-Received: by 2002:a17:902:b696:b0:1a9:bac2:21a2 with SMTP id c22-20020a170902b69600b001a9bac221a2mr2948593pls.21.1683331131122; Fri, 05 May 2023 16:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683331131; cv=none; d=google.com; s=arc-20160816; b=Ozp46/NwwlBwgnPU+81zrGC611DPWNH9soUpnIB/biaAtkcMEDuB/Xbb9hjWEuApbe dK36iy9ujjjR/EulPrO8YKfcVenb2ZtXEysB8Z0wkztTvffGlWUkHXF762lWuUCU7sPL IHTh1eaQ3kSpyOj8W9lNqvFsc9GUPyvR+b6YbenSgyrrJ+ybBV0mnnDxdY3fIEEX1drg vIak4LMTpr0ZLwSl3//2OTlrflxaihX6JF6mjM9jjk/JTOSLCLoQe4TU9JWbNPzSaAwT euv9lvbPgh4MEYnShHKDIReRhSgm642gTyHGVNhrni83jumuCqokqmceB/apsIEkXx5O wYVQ== 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=OtxxnW9p2nerlXGh0d+JG1ehfydOLVNIdu+32Zh+/84=; b=vy8RlrvOoCaJMr7KVXBiLk/vxMvvia0KWX6tPLP8yMtl01Cgr7/blmshHYNfVrTZgT 7ws/hoSCL6HqlnaHIfB0cFRd3XhqhxWsoRaQ4hpUcR5NwlhfuALNzraZgbMB6DYDzkL2 Uq7uwGD1MkpnRqb+rTNrIThQ4iu5ddGKTfz3ZHDx1dkw88e3xc9baG2l8OmJI3xmbpD7 3mQkS6z5bT8T7YPCks9g+M4dgQQR5keYvWyd9s6pjmclej/BDUjVYrm4aBRbeSSXIcu7 MlyJS6sgmAm1UoJWb4R0C0TAxbRrUsqlyReMnoI9uQfpBWpcEkRUn2XSCrgu6uVnZrq2 S6rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="foM67Q/b"; 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 x6-20020a170902ea8600b001aae905065csi2608299plb.284.2023.05.05.16.58.38; Fri, 05 May 2023 16:58:51 -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=desiato.20200630 header.b="foM67Q/b"; 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 S232570AbjEEXji (ORCPT + 99 others); Fri, 5 May 2023 19:39:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbjEEXjh (ORCPT ); Fri, 5 May 2023 19:39:37 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C22C4EE1 for ; Fri, 5 May 2023 16:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=OtxxnW9p2nerlXGh0d+JG1ehfydOLVNIdu+32Zh+/84=; b=foM67Q/bK3dp3031L+6kA925fD JQu1meEpFCKkAK5Nrx1P9gtmfQd8V0PzXF8oFO1f5qlOACKjsmCsXx3irqDi5l/UXO+UH5cyEO8dL cj7rBGh9r96KFIwyTuyijJOgB+UwfwsySuxPXYGtb/cUyt/SQqFylKWFOBKqDlYcEpNfNMDagbs+W d4TuXKqKs+KMvUpIUXb7g4+RldkZ5tXiezKOt1a55eKDYsImXuYFSG+hLX9CiH7aIHThy2TixEzEk Dz6Ae2O4k3sMp7+7F5jNWJXWAXH+ajhtAwdoasdzW17BCGKNxvjfBJiqmn6UOVNDmSr1+5U9X3Zzd IsQJFwRQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pv50Z-003P3L-34; Fri, 05 May 2023 23:38:43 +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 EC0C93060E5; Sat, 6 May 2023 01:38:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A3CB423C5C32C; Sat, 6 May 2023 01:38:36 +0200 (CEST) Date: Sat, 6 May 2023 01:38:36 +0200 From: Peter Zijlstra To: Tim Chen Cc: 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, Shrikanth Hegde , Srikar Dronamraju , naveen.n.rao@linux.vnet.ibm.com, Yicong Yang , Barry Song , Ricardo Neri Subject: Re: [PATCH 4/6] sched/fair: Skip prefer sibling move between SMT group and non-SMT group Message-ID: <20230505233836.GB1821641@hirez.programming.kicks-ass.net> References: <20230505132211.GQ83892@hirez.programming.kicks-ass.net> <7c5ad793fe0195f7129156b67a043df18b46d732.camel@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c5ad793fe0195f7129156b67a043df18b46d732.camel@linux.intel.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 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 Fri, May 05, 2023 at 04:07:39PM -0700, Tim Chen wrote: > On Fri, 2023-05-05 at 15:22 +0200, Peter Zijlstra wrote: > > On Thu, May 04, 2023 at 09:09:54AM -0700, Tim Chen wrote: > > > From: Tim C Chen > > > > > > Do not try to move tasks between non SMT sched group and SMT sched > > > group for "prefer sibling" load balance. > > > Let asym_active_balance_busiest() handle that case properly. > > > Otherwise we could get task bouncing back and forth between > > > the SMT sched group and non SMT sched group. > > > > > > Reviewed-by: Ricardo Neri > > > Signed-off-by: Tim Chen > > > --- > > > kernel/sched/fair.c | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > > index 8a325db34b02..58ef7d529731 100644 > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -10411,8 +10411,12 @@ static struct sched_group *find_busiest_group(struct lb_env *env) > > > /* > > > * Try to move all excess tasks to a sibling domain of the busiest > > > * group's child domain. > > > + * > > > + * Do not try to move between non smt sched group and smt sched > > > + * group. Let asym active balance properly handle that case. > > > */ > > > if (sds.prefer_sibling && local->group_type == group_has_spare && > > > + !asymmetric_groups(sds.busiest, sds.local) && > > > busiest->sum_nr_running > local->sum_nr_running + 1) > > > goto force_balance; > > > > This seems to have the hidden assumption that a !SMT core is somehow > > 'less' that an SMT code. Should this not also look at > > sched_asym_prefer() to establush this is so? > > > > I mean, imagine I have a regular system and just offline one smt sibling > > for giggles. > > I don't quite follow your point as asymmetric_groups() returns false even > one smt sibling is offlined. > > Even say sds.busiest has 1 SMT and sds.local has 2 SMT, both sched groups still > have SD_SHARE_CPUCAPACITY flag turned on. So asymmetric_groups() return > false and the load balancing logic is not changed for regular non-hybrid system. > > I may be missing something. What's the difference between the two cases? That is, if the remaining sibling will have SD_SHARE_CPUCAPACIY from the degenerate SMT domain that's been reaped, then why doesn't the same thing apply to the atoms in the hybrid muck? Those two cases *should* be identical, both cases you have cores with and cores without SMT.