Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35974938rwd; Mon, 10 Jul 2023 15:58:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlHSB01E/CRtaU2I9YCh14okr41yCjdEiBDblgpD2Nh4rtaejX7c8UnTB1pOi5Mt6HnVpl8m X-Received: by 2002:a17:907:7896:b0:992:be80:aaf9 with SMTP id ku22-20020a170907789600b00992be80aaf9mr15436347ejc.51.1689029901470; Mon, 10 Jul 2023 15:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689029901; cv=none; d=google.com; s=arc-20160816; b=jWi9zJ8+979yULxB849R1beyjz8eYQks8NlyN+Ik7QnKvHLACqUMNg83W0umcrXopI ArjiDB6Pm86qKsvusPAOIRd7+WFzhpcYGPfA1PMMmjqHhXoqOZPI7lWiQ0q80UXJCqHl g+zzw5hpVYQBqCdJl3Ceuk1YGqaXlpP0rpi8WZPBF2a4d6dxQGNXXKAp+2LteFPgR3ZW jZnKF/aY/ZUEFktgFYKcDn6SzSJ/ma5W06eKD13WuBPYYuWEl15QT8cOpcRTkenmL+Dm XTu3swAWfd6WhofBU4iKBT5ruz1069UJo9J0WkchBwWh8DaCJOOxrqWOubeJADzlGTeO j9MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Ly675Dt2JrjXCnRon6WamyKsfF9v2N5+dVswrxkzUR8=; fh=FHz2JdmqxqOmF1AE2xeWGMCv1kNQeiXejnYifEwuwQw=; b=lFMVX/CimpE41yTo6NwwwF6Z8zpvbdvyvRmqV/WeJvwOHDsXtB1o62XanBS2To4HkE aPU02f10BqRejdro7unMLsTptIhVO+VHZHBEy41ANGq1qMQuer6x+0Hqwq0hdPo4NWY8 2/L0+4VTkVaznoX64/ovcQcy2tUXCX69/tI59nVFpJgk5ZX/osKnFT2gL9haevureohZ tLrn1JB6/cHZOJytAew+v2363taO2Dxcb2d/tpF/lLzk8JPW8KNQtkONkUFqc2LcLpI1 Kh2L5nnZGSespTu3SNR4fAVMe8u4T2ieDLLAow8fklQuYgox785g+6WL7EiZJaK90Wpr 1n3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="TQLs/XNZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a170906384400b0097391f75082si600922ejc.838.2023.07.10.15.57.57; Mon, 10 Jul 2023 15:58:21 -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=@intel.com header.s=Intel header.b="TQLs/XNZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbjGJWki (ORCPT + 99 others); Mon, 10 Jul 2023 18:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbjGJWkh (ORCPT ); Mon, 10 Jul 2023 18:40:37 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B10719C for ; Mon, 10 Jul 2023 15:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689028836; x=1720564836; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=2PGHiZTbE9WmEOrGsLfCFHLRDzE9rVhZjD1SYYpb2Ms=; b=TQLs/XNZT9nP3Gan14uCJFltnEwPL7yCjo4FkcJkbxao6IVOEbVE17r7 wuCMnsNOwzaM59i006P/n/Hj0x0WLG57BB4jydhJgB/3yh6xT5M7UMEND +cmIxYpuqIXQs0OCt8IHjr2stMMRCBVg3dSy0NROn2a1+wIUXGdihVrzG kNB1IXdRnMTy3BcSafNrNj4K82He1wdlbMbM2H72A0ANVc5+X6qMF5IZd NgaoP5NGXM3ROetKyPsoEN4tAk4gS0OByk8ON00SIeqUeO5GOeVoh5dB7 d6VynMuAKTgvnm1mS6QdUf8rvYWvenW9H4Jmb+61ZxBTqBP4oc975ll8i A==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="450837200" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="450837200" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 15:40:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="698202410" X-IronPort-AV: E=Sophos;i="6.01,195,1684825200"; d="scan'208";a="698202410" Received: from rmirwin-mobl.amr.corp.intel.com (HELO [10.209.4.178]) ([10.209.4.178]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 15:40:35 -0700 Message-ID: <4797e9147143decf561ede6b7658721d05dda4dc.camel@linux.intel.com> Subject: Re: [Patch v3 2/6] sched/topology: Record number of cores in sched group From: Tim Chen To: Peter Zijlstra 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 Date: Mon, 10 Jul 2023 15:40:34 -0700 In-Reply-To: <04641eeb0e95c21224352f5743ecb93dfac44654.1688770494.git.tim.c.chen@linux.intel.com> References: <04641eeb0e95c21224352f5743ecb93dfac44654.1688770494.git.tim.c.chen@linux.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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, 2023-07-07 at 15:57 -0700, Tim Chen wrote: > From: Tim C Chen >=20 > 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? Tim >=20 > Signed-off-by: Tim Chen > --- > kernel/sched/sched.h | 1 + > kernel/sched/topology.c | 10 +++++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) >=20 > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index 3d0eb36350d2..5f7f36e45b87 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -1860,6 +1860,7 @@ struct sched_group { > atomic_t ref; > =20 > unsigned int group_weight; > + unsigned int cores; > struct sched_group_capacity *sgc; > int asym_prefer_cpu; /* CPU of highest priority in group */ > int flags; > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index 6d5628fcebcf..6b099dbdfb39 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -1275,14 +1275,22 @@ build_sched_groups(struct sched_domain *sd, int c= pu) > static void init_sched_groups_capacity(int cpu, struct sched_domain *sd) > { > struct sched_group *sg =3D sd->groups; > + struct cpumask *mask =3D sched_domains_tmpmask2; > =20 > WARN_ON(!sg); > =20 > do { > - int cpu, max_cpu =3D -1; > + int cpu, cores =3D 0, max_cpu =3D -1; > =20 > sg->group_weight =3D cpumask_weight(sched_group_span(sg)); > =20 > + cpumask_copy(mask, sched_group_span(sg)); > + for_each_cpu(cpu, mask) { > + cores++; > + cpumask_andnot(mask, mask, cpu_smt_mask(cpu)); > + } > + sg->cores =3D cores; > + > if (!(sd->flags & SD_ASYM_PACKING)) > goto next; > =20