Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1587804rwr; Fri, 5 May 2023 17:09:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oy2pbmpc+8I4T/DPsc6C5hlpZ5BXMIob3r4iHF1TBF7KmZdTLFzXuEtFL22iwVMneRQch X-Received: by 2002:a17:90a:e545:b0:24e:2e86:5465 with SMTP id ei5-20020a17090ae54500b0024e2e865465mr3047811pjb.31.1683331742808; Fri, 05 May 2023 17:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683331742; cv=none; d=google.com; s=arc-20160816; b=tjoTEmTij3qwucmTH8JddIlVg9QisEChtn9oJ1RMyP7cX4/H/+sR+LVZPu5z110Z1Q MAa8dvUmY3ABi1N/hQRgy0HSVmkdwWMxTS2uEc7MKakQhKFmcy6lm9MWAQihLcq9z/zT 45wHZsquPxLW+OXlwjLTrpGSCgdRh3TYZp+hEowEd6YC/9w4VRXiLBYwBVy0ej4F4m6A 1LlMcLfWxJrkLCaiAhp6qQifBMIgdiyf/l1cXOPE3tkJNvTmnX7w/Uvac8b77b4BQbED 5n5lr8Sjh3yl+vRjPv2AtO05j5Iu+qStgJ5mJszP+3Nalx4lXj/xPiOmqQo/I2JdTteg gAmA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3ivfYN9NFn5Ur3KwxVm0BlzaXOloF+5cCvdC28BiwI4=; b=yeYbbbLGmlijjCSSPUSG2Q1UVIEom9mypBwhzfibXjR7AnWk6WLav+HnG+KtMqwjnB JACraS+Gvjgk9s8wWe8xXSE7b66v++3kBP2VY/5UXH971loYctuVzTBqFyQhpMl0jC1h hiNiSOzPKKn4w+LWxERhdX05Xor5d1GZdHTEnW912PxdJdaUgObyBHXihy6BOl7seMss 4r9vLHk8dwvafMZGdHM6NPeTBs1HZZgbxDP7tRAZDp9HmO9BodDReisCmADApnJP71E1 +7RT6mqj9gC2CihbQSWoMRxWNxDVt4hwDn/mmL2hls5p8z7+Ckd1SUbCAj/PEsGfCO9T 9RLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=W1rNGpt1; 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 g11-20020a17090a128b00b002472cd8ded6si2400042pja.103.2023.05.05.17.08.48; Fri, 05 May 2023 17:09:02 -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=W1rNGpt1; 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 S231854AbjEEXpn (ORCPT + 99 others); Fri, 5 May 2023 19:45:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjEEXpl (ORCPT ); Fri, 5 May 2023 19:45:41 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A20995FD9 for ; Fri, 5 May 2023 16:45:40 -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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=3ivfYN9NFn5Ur3KwxVm0BlzaXOloF+5cCvdC28BiwI4=; b=W1rNGpt1ik2K6PIZZMqij1tv9L mCvK5ahfCpGV6XL7aKQln5qDUx7Qdmol/yrkd5fEs9mq5QOBXOshL7j7F3p2MVXssTxWOw9iIJYI3 LcRqqCqcCpiAnfi88cqhUl9oZqJKD9lMgmdKaSmhDd4C7fXNF4YoYhs0/cm90hpd9kkk7CL7RNtGE G58h8vpqR5iH5DpkOwh6P5N57JboVnp2nK0hyl7pBehjinCo80XmwMPxKChlR06Id9zN0oCaU3CdV EfuHk4Qozju77oivwjy5W1JDNGXi+d1smK6tHyk5/Bs6IH50SKzxjRj4RNBj1SBKs2LlhVJTlnrQU I/fb3tXQ==; 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 1pv56g-00BzAc-C2; Fri, 05 May 2023 23:44:58 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2D7A430022D; Sat, 6 May 2023 01:44:57 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E0E3E23C5C32C; Sat, 6 May 2023 01:44:56 +0200 (CEST) Date: Sat, 6 May 2023 01:44:56 +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 2/6] sched/fair: Check whether active load balance is needed in busiest group Message-ID: <20230505234456.GC1821641@hirez.programming.kicks-ass.net> References: <231cf298efb8627499bb42788588a6108c7b8f7c.1683156492.git.tim.c.chen@linux.intel.com> <20230505121631.GF4253@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 03:29:45PM -0700, Tim Chen wrote: > On Fri, 2023-05-05 at 14:16 +0200, Peter Zijlstra wrote: > > > > > +static inline bool asym_active_balance_busiest(struct lb_env *env, struct sd_lb_stats *sds) > > > +{ > > > + /* > > > + * Don't balance to a group without spare capacity. > > > + * > > > + * Skip non asymmetric sched group balancing. That check > > > + * is handled by code path handling imbalanced load between > > > + * similar groups. > > > + */ > > > + if (env->idle == CPU_NOT_IDLE || > > > + sds->local_stat.group_type != group_has_spare || > > > + !asymmetric_groups(sds->local, sds->busiest)) > > > + return false; > > > + > > > + /* > > > + * For SMT source group, pull when there are two or more > > > + * tasks over-utilizing a core. > > > + */ > > > + if (sds->busiest->flags & SD_SHARE_CPUCAPACITY && > > > + sds->busiest_stat.sum_h_nr_running > 1) > > > + return true; > > > + > > > + return false; > > > +} > > > > This all seems to be mixing two 'asymmetric' things in the 'asym' > > namespace :/ One being the SD_ASYM_PACKING and then the above SMT/no-SMT > > core thing. > > Yeah, I am kind of abusing the "asymmetric" word. However, the above > code does try to set things up for the aysm_active_balance() code > later. Any suggestion on better names for "asymmetric_groups()" and > and "asym_active_balance_busiest()"?? > > Perhaps "hybrid_groups()" and "hybrid_active_balance_busiest()"? As per the other subthread; I really don't think this whole SMT vs non-SMT should be in any way shape or form be related to hybrid. Offlining siblings should really get you the same topology. (and if that currently is not the case, that should be fixed) (and also; we should probably add group_flags to /debug/sched/domains/cpuN/domainM/ so we can actually see what's what, because this seems to be a bit of a blind spot). That also suggests the hybrid naming suggestion is not a very good one. And I'll blame it being nearly 2am for not being able to come up with a good suggestion, but I'm thinking it ought to have SMT in the name somehow.