Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp70161rdb; Fri, 29 Sep 2023 17:16:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6A+4Nazu0tm/xJyET1Ptm6oMp0qH742SSUhD/t6ca2xzhIPG6IFbe/NWpcf4ARhHwHJ+B X-Received: by 2002:a05:6a21:32a1:b0:13a:6bca:7a84 with SMTP id yt33-20020a056a2132a100b0013a6bca7a84mr6903954pzb.44.1696033003491; Fri, 29 Sep 2023 17:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696033003; cv=none; d=google.com; s=arc-20160816; b=nSM4NXLiveZR1H/Qub0pP6PTllUPJJOKC3uYmAo1GggtFE5a5XzjnIwtXAwye+gnf/ edpv7exwTlHCzIvHHhr5j88zx6ZEw3e4Fd8y/qpCm99ycvz5Ek70EzPkebKyRM7BkV7q IV6ptTa4sEC93bkxi4M/yQ8vIpzCxiuua/ZoQIb8OhYe/4+Dp5U3sHS9DyiKfSefOR8W Zy4Jm2BVUfjEBluTsponsumgl4ZlRrJzYL2zJFflWXadG2MmMrhmU2K7eP+h3eZ64F4U J5gl5rsP6B+40xWMJuLfjeGd25XfjmRvLIk+/EX4az/P5JRA7P/OT3A82JSL26QQlWf5 oAaA== 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=0iNzOj3ei2G77zr3ZsFZ0+6u9I/ceP4jIfuxQ/YIavc=; fh=ptkWKGWlQNIik+BEoFpIdNhogIbzLH4KDmABrVZ+/f0=; b=zCqQ/iaRxlh7cTEOHxsL9rGPI4Wn0tSa32vbc9Hj0RzT+i8Wb5mpW3HhYrFHyBPnQ3 8aLCxe0GLfwNdJJlDqfm2F/FGV/ViNuDlkJ9qDKIZhwh7t4WVxtYdfK1LcPwN3kb0laf +5PygHxVtgUpyiC21YvPvIk/qXuLNctQZgmMyl5QriNjxI7blx52OXS6kbFaGjKRvbAB AvhShZcTuqYG26Vw1Tvv4C41q1Euo5OzscY4TEzBvDoOx2HRkapSldZL84RZ2Va8SWCR UsUafv+yB270fAe5C7HHpDjIx1IhH3GynA8Lua/SfXi2v0qbwiMBV5a9wxBvf2oVZu4g LNaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FOZTdSJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ne12-20020a17090b374c00b00276c28cdd4fsi2450423pjb.31.2023.09.29.17.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 17:16:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FOZTdSJa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4048182CEE55; Fri, 29 Sep 2023 13:48:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233857AbjI2Us0 (ORCPT + 99 others); Fri, 29 Sep 2023 16:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233828AbjI2UsY (ORCPT ); Fri, 29 Sep 2023 16:48:24 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33FCE1AB; Fri, 29 Sep 2023 13:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696020499; x=1727556499; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=tXfZaIVeQzhgci4D2hG+Kx5EgnvkGliDQ/EynlWJjdo=; b=FOZTdSJa0BpiqhWLN0Vd46qxQ7pX8XkzUxhPnye+S+K2H56G8iP/8zt2 keKlHZ4tDggQ5q1y90FoIDVeNCvL8eQnYRgp4qsUCqHHCBmw6UczmmAvt QXe4FPMqhQheJ2lXZiq58MLdHeoaNeOyYNaa4uWvcnRNU5f5jdOWI9uNv hFsdoit4lSh8+WGhZawCh1LZraUn7+QceyBcqM6tz2Jfa4x1SGYcPkHfs xPQgEdmfqb09o/IdeQ7RgSp0qLjmSNgbJ8QRODpfxS4RIRMb8JhasDQCB Y/fsA59ZBm2krrhdzrhNk0f6ibtBtOLhiSKHCE1rcQccxBCzM4Bx4qulD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="386239718" X-IronPort-AV: E=Sophos;i="6.03,188,1694761200"; d="scan'208";a="386239718" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 13:18:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="779369649" X-IronPort-AV: E=Sophos;i="6.03,188,1694761200"; d="scan'208";a="779369649" Received: from agluck-desk3.sc.intel.com (HELO agluck-desk3) ([172.25.222.74]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 13:18:02 -0700 Date: Fri, 29 Sep 2023 13:18:00 -0700 From: Tony Luck To: Peter Newman Cc: Fenghua Yu , Reinette Chatre , Jonathan Corbet , Shuah Khan , x86@kernel.org, Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v6 6/8] x86/resctrl: Introduce snc_nodes_per_l3_cache Message-ID: References: <20230829234426.64421-1-tony.luck@intel.com> <20230928191350.205703-1-tony.luck@intel.com> <20230928191350.205703-7-tony.luck@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 13:48:41 -0700 (PDT) On Fri, Sep 29, 2023 at 04:21:54PM +0200, Peter Newman wrote: > Hi Tony, > > On Thu, Sep 28, 2023 at 9:14 PM Tony Luck wrote: > > > > Intel Sub-NUMA Cluster (SNC) is a feature that subdivides the CPU cores > > and memory controllers on a socket into two or more groups. These are > > presented to the operating system as NUMA nodes. > > > > This may enable some workloads to have slightly lower latency to memory > > as the memory controller(s) in an SNC node are electrically closer to the > > CPU cores on that SNC node. This cost may be offset by lower bandwidth > > since the memory accesses for each core can only be interleaved between > > the memory controllers on the same SNC node. > > > > Resctrl monitoring on Intel system depends upon attaching RMIDs to tasks > > to track L3 cache occupancy and memory bandwidth. There is an MSR that > > controls how the RMIDs are shared between SNC nodes. > > > > The default mode divides them numerically. E.g. when there are two SNC > > nodes on a socket the lower number half of the RMIDs are given to the > > first node, the remainder to the second node. This would be difficult > > to use with the Linux resctrl interface as specific RMID values assigned > > to resctrl groups are not visible to users. > > > > The other mode divides the RMIDs and renumbers the ones on the second > > SNC node to start from zero. > > > > Even with this redumbering SNC mode requires several changes in resctrl > > behavior for correct operation. > > redumbering? Harsh. Spell check didn't catch this. Implies that redumbering is a real word! Now I need to find an opportunity to use it :-) Changed to renumbering. > > > > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > index b0901fb95aa9..a5404c412f53 100644 > > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > > @@ -1357,7 +1357,7 @@ unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r, > > } > > } > > > > - return size; > > + return size / snc_nodes_per_l3_cache; > > To confirm, the size represented by a bit goes down rather than the > CBM mask shrinking in each sub-NUMA domain? Correct. The CBM mask keeps the same number of bits. Those bits are all available to control allocation in each SNC node. But the amount of cache you get per-bit is reduced in the ratio of the number of SNC ways. > > I would maybe have expected the CBM mask to already be allocating at > the smallest granularity the hardware supports. > > > } > > > > /** > > @@ -2590,7 +2590,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) > > ctx->enable_cdpl2 = true; > > return 0; > > case Opt_mba_mbps: > > - if (!supports_mba_mbps()) > > + if (!supports_mba_mbps() || snc_nodes_per_l3_cache > 1) > > Factor into supports_mba_mbps()? Agreed. That's a better place. Moved this test into supports_mba_mbps(). > > > return -EINVAL; > > ctx->enable_mba_mbps = true; > > return 0; > > -- > > 2.41.0 > > > > Reviewed-by: Peter Newman Thanks -Tony