From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF389C88CB5 for ; Mon, 12 Jun 2023 20:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233650AbjFLURE (ORCPT ); Mon, 12 Jun 2023 16:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbjFLURB (ORCPT ); Mon, 12 Jun 2023 16:17:01 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780511BF for ; Mon, 12 Jun 2023 13:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686601015; x=1718137015; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=jJcLMAcSmqVtvgK1Jq9rsW+3+3BxRpUOu7dfbaj6WLw=; b=bZMi5fel2G9HcR9lbvgucvLpBOA2MSoehIyF6BMhUpkeXOSup5a/Rk/q 0azwsXYAZ1krWAFsB7MkIelk3GpPlCYktZoXPnLGSzQnEQbrd6cDIedl9 oJ+gH0h5DxV1SRaURAv1nODTKFeVeJmhDwwoAmj+R0eEMU1QjxPb51/ZX KvmWyygL2eHHlsyS+auiYBFOBkB2vH1AzgN8hIxICYBWtIg44J8N2yxw/ Qp5dLgTa/dpPneC+KWw/qGzk7sf3hBYqoIxEwzENv/kHuUHaMi1sbdEgf ZzdS2MRI35xjA7hf6yn5K4iKpDEkSnh/gLWGHUrBuHODyGmuojFePtJA8 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="361516777" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="361516777" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 13:16:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="1041479391" X-IronPort-AV: E=Sophos;i="6.00,236,1681196400"; d="scan'208";a="1041479391" Received: from fwbrewes-mobl.amr.corp.intel.com (HELO [10.255.230.147]) ([10.255.230.147]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 13:16:53 -0700 Message-ID: Subject: Re: [Patch v2 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, 12 Jun 2023 13:16:52 -0700 In-Reply-To: <20230612112945.GK4253@hirez.programming.kicks-ass.net> References: <20230612112945.GK4253@hirez.programming.kicks-ass.net> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2023-06-12 at 13:29 +0200, Peter Zijlstra wrote: > On Thu, Jun 08, 2023 at 03:32:28PM -0700, Tim Chen wrote: > >=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 > Just a note; not sure we want or can do anything about this, but > consider someone doing partitions like: >=20 > [0,1] [2,3] [3,6] > [------] [------] >=20 > That is, 3 SMT cores, and 2 partitions splitting an SMT core in two. >=20 > Then the domain trees will see either 2 or 3 but not the fully core. >=20 > I'm perfectly fine with saying: don't do that then. I also can't see a reason to split SMT between two domains. Tim