Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36693604rwd; Tue, 11 Jul 2023 04:38:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlFDKbPNrEax5V6NBI/2B0AoZOYZcU2FDc+4k7l5ShIzUUXtgcDWeDRmgEAg4Xrbdllj89lR X-Received: by 2002:a05:6358:3386:b0:135:515c:38ee with SMTP id i6-20020a056358338600b00135515c38eemr8636903rwd.25.1689075516898; Tue, 11 Jul 2023 04:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689075516; cv=none; d=google.com; s=arc-20160816; b=w2eIKuLvaCzopG6/JWlQGAA60aclPnjM9tBnJQiVHYdkFluL0S3nVi5SpsNS39wtxP G/xoe/ylDqmS7G0J/PK4Ty7i0ix/OVnCanRo+b7Nz8s+YH+06ZOS49TShWA7KqHUOTXP A+qyHOZr45n6eSiQlATnN/82inVmONa7x8/AsRqYB2lKiiqKAoqrw2Jp9B2TkN62hkyC g2qzpkbH4VRnqSCJnu6Z8UFnQUdehANzUEDJFjGtK+894r2cyRq+dzrOKlQQeL/Irz3y jeY8SCG6aLm5jtzf94eomGrUIttBkTxtcnp7wgxySW0G2x/k+fsfU4vTX3bBHzk3yqIS dFBw== 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=XqgoWL9LCniJF/VVbTLcSycpWfuGM7KgkkgzB8rRFNM=; fh=2RcOZVWTd+99ygV5TsrDZDuThmvf4WLpyF7zJWrYix4=; b=cYm1ZsTHHraVA9VZElRwiFbI6Kpj1FHFZrlK6Uffe+Z5cp7YW2nNwE1cXRcR2wC0KU HuhWdR42Lf1nIIxQc9X3mI0eWsr6y2ufHIeOzogH1kyyl+Q3k8eOQkq+MWuiNzaFEDI1 LI1uvUxqjS6wlxGb5ESn7ERDvCmkymjH7sf/5QxRLS86PYVmrWugkJ2zGkrEj52bYxQD FwCJG8HuOVwuZeOJSvntxN+WRl0rzVa4OYc4Y/VhN7GFzLDfwYBI0AL8xlzZYXLdmJam lNxnPvF/y8JIPHWMA9zv7fu5ASft5E9U4n4EAhvkerocnnWI+yJYZTcFYW2Rgky946RU fTjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=c2aX5ppc; 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 a22-20020a631a56000000b0055ba8970e7dsi1211839pgm.677.2023.07.11.04.38.24; Tue, 11 Jul 2023 04:38:36 -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=c2aX5ppc; 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 S230393AbjGKLco (ORCPT + 99 others); Tue, 11 Jul 2023 07:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjGKLcm (ORCPT ); Tue, 11 Jul 2023 07:32:42 -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 A9547127 for ; Tue, 11 Jul 2023 04:32:41 -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=XqgoWL9LCniJF/VVbTLcSycpWfuGM7KgkkgzB8rRFNM=; b=c2aX5ppcvu2VslvkDX3y/gtJph mJcJfublX0YhUR1AsTGezG06pQ5iRow76GdWd5hX6jPxDxbTiLBvS610y3wGHxvsmiG+EO2pBv/3w BShKT0yw84G12YaJlD1Wseh0pzYQUPLvOMPXy5AkhLW2JYogXMahzwe/wS2lIFcyk83SJjklryquJ w2abnEicSATbUBfUOYpdeF36Hl8sYCc3KetHI3T0lT8Np1VcG7IkxwvNwrNYG9xWpRsvytsB0R5Zq XII5MnT82Y0Q0R/ew66/VBpIfVwEC7PQdHxKCSlZOb8NwxdVG0hmmMIn9/2olZvv+KnE1j3LY+Ren qRHOglRA==; 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 1qJBb7-002NoV-1W; Tue, 11 Jul 2023 11:32:01 +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 0AF4430036B; Tue, 11 Jul 2023 13:31:59 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E0EFC240EBDB4; Tue, 11 Jul 2023 13:31:58 +0200 (CEST) Date: Tue, 11 Jul 2023 13:31:58 +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 , Chen Yu , Hillf Danton Subject: Re: [Patch v3 2/6] sched/topology: Record number of cores in sched group Message-ID: <20230711113158.GJ3062772@hirez.programming.kicks-ass.net> References: <04641eeb0e95c21224352f5743ecb93dfac44654.1688770494.git.tim.c.chen@linux.intel.com> <4797e9147143decf561ede6b7658721d05dda4dc.camel@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4797e9147143decf561ede6b7658721d05dda4dc.camel@linux.intel.com> 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,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:40:34PM -0700, Tim Chen wrote: > On Fri, 2023-07-07 at 15:57 -0700, Tim Chen wrote: > > From: Tim C Chen > > > > When balancing sibling domains that have different number of cores, > > tasks in respective sibling domain should be proportional to the number > > of cores in each domain. In preparation of implementing such a policy, > > record the number of tasks in a scheduling group. > > Caught a typo. Should be "the number of cores" instead of > "the number of tasks" in a scheduling group. > > Peter, should I send you another patch with the corrected commit log? I'll fix it up, already had to fix the patch because due to robot finding a compile fail for SCHED_SMT=n builds. > > @@ -1275,14 +1275,22 @@ build_sched_groups(struct sched_domain *sd, int cpu) > > static void init_sched_groups_capacity(int cpu, struct sched_domain *sd) > > { > > struct sched_group *sg = sd->groups; > > + struct cpumask *mask = sched_domains_tmpmask2; > > > > WARN_ON(!sg); > > > > do { > > - int cpu, max_cpu = -1; > > + int cpu, cores = 0, max_cpu = -1; > > > > sg->group_weight = cpumask_weight(sched_group_span(sg)); > > > > + cpumask_copy(mask, sched_group_span(sg)); > > + for_each_cpu(cpu, mask) { > > + cores++; #ifdef CONFIG_SCHED_SMT > > + cpumask_andnot(mask, mask, cpu_smt_mask(cpu)); #else __cpumask_clear_cpu(cpu, mask); #endif or something along them lines -- should be in queue.git/sched/core already. > > + } > > + sg->cores = cores; > > + > > if (!(sd->flags & SD_ASYM_PACKING)) > > goto next; > > >