Message ID | 20230126184157.27626-6-tony.luck@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp429319wrn; Thu, 26 Jan 2023 10:45:41 -0800 (PST) X-Google-Smtp-Source: AK7set9xF6Z3dqeWdLZmKtEAanXBhQb8R+HC0BbJ1gzVzWFEN56ZN385FuMURRQCpTfgcwnh6f9G X-Received: by 2002:a62:828b:0:b0:590:70e0:c6a9 with SMTP id w133-20020a62828b000000b0059070e0c6a9mr5377754pfd.32.1674758741035; Thu, 26 Jan 2023 10:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674758741; cv=none; d=google.com; s=arc-20160816; b=z/33GEMMkkYf8CfMK7V09y7D9P0LZKpmCMClWMM5bb/fSPUB3xGSLTWB2P8+dt71na 7E29QI7knDA2L5US+w65vqiRr+AdrlR41Qm5gw/zGd6n7ZBt2qtJeqivt/IdhwKp5bcF eKMs9aVptouO8C7QLj1WoiPPRj+HcNYcAnGxNkvL3We62wh8+muuw9ujMFxPZdxx1ng7 df5zN8qFMWy6bR3sPz+9q5hv9ufHAz0hs9tIBql1o8Cqt37d9mDEdWDEfa4p37SvGjgQ cUaxsbDwiuiJ89e+5FL6nwq2F5g93hEqj4V/S2PpLUG96P2WzBLr84YQ1LhhGXhfB0kb ZmUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Q6NhNsTvlM//tugqpphfQShKc4dorBvHNARXEmxq1Ho=; b=dm0O40ZUeuHnQSD7jJWMSg/mpX4nwmyDqQAgF+9A7WI2NdaGoXN9hiU/5fMLFkT+wV 3gGA+WOouFXw4oCFgdiI5DPfh7SuvV+au9yA1YnOt3PvmGBEYYhpU0TxmlY88CzbP8pC qGdWMVaE/K2/U8h8CdzGUSyUUURLfxJFgOLAJUUIzFe33B5vyKs4qhuq8MYtCx++q9Hq eFWlX4C7p3wkmpAEKXOCekHi3fcctUXZESuOHRLY9gxEsGgIses42K6U5/StJPMaCUoJ NC5dFDg5Yf7+qvvjfKyou3CNlXVQFNvimYDfa0Z88YBk4SUJa/33kYdIljtKgOtNVWk2 hlkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YZr0bbBf; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020aa7824e000000b0056ea2b1b0fesi1790083pfn.119.2023.01.26.10.45.29; Thu, 26 Jan 2023 10:45:41 -0800 (PST) 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=YZr0bbBf; 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 S232237AbjAZSmt (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Thu, 26 Jan 2023 13:42:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231513AbjAZSmd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Jan 2023 13:42:33 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F314474C7; Thu, 26 Jan 2023 10:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674758553; x=1706294553; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lazqj33+wcKOHpjgmXNXHNJZww2MNyt2EHBaLJXRYCw=; b=YZr0bbBfahBUfu/3SAMOQ6hI6BwMxQ8CQFasPDZ5HwLV8kesrv8s24Hl 0WtUe9oo8GJn8+c+IALbhD/LlfL/SU3gSzPTB5qofKctBLWJTrqFrUo5O ShanDrlviRiTEOeOGS5wHs2QY8SGYhwixZvyGox93/YAIQOSZJCJHH3wM 6od47+f5NrPNwX9WRpbqQrmPETE+U01LzrqGmGjNSnxIknaDJ4HNj07kX Majv+Ly4+zHupenxDshgdJYVAUU1db7mBqhns5iPiMUy8Hn4ii9X7/4H9 kygaLFTiKrRg32zbGrA3E4+K1P7LDjFoY0bwfxQ9t/LqnVDxSkRWnGg3k g==; X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="354203361" X-IronPort-AV: E=Sophos;i="5.97,249,1669104000"; d="scan'208";a="354203361" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2023 10:42:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="991745452" X-IronPort-AV: E=Sophos;i="5.97,249,1669104000"; d="scan'208";a="991745452" Received: from agluck-desk3.sc.intel.com ([172.25.222.78]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2023 10:42:06 -0800 From: Tony Luck <tony.luck@intel.com> To: Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Peter Newman <peternewman@google.com>, Jonathan Corbet <corbet@lwn.net>, x86@kernel.org Cc: Shaopeng Tan <tan.shaopeng@fujitsu.com>, James Morse <james.morse@arm.com>, Jamie Iles <quic_jiles@quicinc.com>, Babu Moger <babu.moger@amd.com>, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck <tony.luck@intel.com> Subject: [PATCH 5/7] x86/resctrl: Add a new "snc_ways" file to the monitoring info directory. Date: Thu, 26 Jan 2023 10:41:55 -0800 Message-Id: <20230126184157.27626-6-tony.luck@intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230126184157.27626-1-tony.luck@intel.com> References: <20230126184157.27626-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756111821664181037?= X-GMAIL-MSGID: =?utf-8?q?1756111821664181037?= |
Series |
x86/resctrl: Add support for Sub-NUMA cluster (SNC) systems
|
|
Commit Message
Luck, Tony
Jan. 26, 2023, 6:41 p.m. UTC
Make it easy for the user to tell if Sub-NUMA Cluster is enabled by
providing an info/ file.
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Comments
Hi Tony, On 26/01/2023 18:41, Tony Luck wrote: > Make it easy for the user to tell if Sub-NUMA Cluster is enabled by > providing an info/ file. I think what this is conveying to user-space is 'domain_id_is_numa_node'. Does user-space need to know the number of ways? Will this always be a single number, or will it ever be possible to have an SNC=2 and SNC=1 package in the same system? Thanks, James > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index a0dc64a70d01..392e7a08d083 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -997,6 +997,14 @@ static int rdt_num_rmids_show(struct kernfs_open_file *of, > return 0; > } > > +static int rdt_snc_ways_show(struct kernfs_open_file *of, > + struct seq_file *seq, void *v) > +{ > + seq_printf(seq, "%d\n", snc_ways); > + > + return 0; > +} > + > static int rdt_mon_features_show(struct kernfs_open_file *of, > struct seq_file *seq, void *v) > { > @@ -1451,6 +1459,13 @@ static struct rftype res_common_files[] = { > .seq_show = rdt_num_rmids_show, > .fflags = RF_MON_INFO, > }, > + { > + .name = "snc_ways", > + .mode = 0444, > + .kf_ops = &rdtgroup_kf_single_ops, > + .seq_show = rdt_snc_ways_show, > + .fflags = RF_MON_INFO, > + }, > { > .name = "cbm_mask", > .mode = 0444,
> > Make it easy for the user to tell if Sub-NUMA Cluster is enabled by > > providing an info/ file. > > I think what this is conveying to user-space is 'domain_id_is_numa_node'. That seems more architecturally neutral. I like it. > Does user-space need to know the number of ways? I don't know. Maybe some might. Perhaps there is some better name that is architecturally neutral, but still has a numerical rather than boolean value? > Will this always be a single number, or will it ever be possible to have an SNC=2 and > SNC=1 package in the same system? I sincerely hope that it is the same value across the system. Currently the BIOS setup option to enable SNC doesn't have per-socket choices, it is just an all-or-nothing choice. "2" isn't the only choice for number of SNC nodes on a socket. "4" is (or will be) a choice. -Tony
Hi Tony, On 28/02/2023 17:44, Luck, Tony wrote: >>> Make it easy for the user to tell if Sub-NUMA Cluster is enabled by >>> providing an info/ file. >> >> I think what this is conveying to user-space is 'domain_id_is_numa_node'. > > That seems more architecturally neutral. I like it. > >> Does user-space need to know the number of ways? > > I don't know. Maybe some might. Perhaps there is some better name that > is architecturally neutral, but still has a numerical rather than boolean value? If we don't know what user-space needs this for, I'd prefer we don't expose it. It'll be a problem in the future if there is no single number we can put there. I don't see what the difference between 2 and 4 would be used for when setting up resctrl, unless you are choosing which numa-nodes to spread tasks over ... but the numa distance would be a much better number to base that decision on. User-space is able to perform the same calculation to find the snc_ways using the cache/index stuff and node entries in sysfs. >> Will this always be a single number, or will it ever be possible to have an SNC=2 and >> SNC=1 package in the same system? > > I sincerely hope that it is the same value across the system. Currently the > BIOS setup option to enable SNC doesn't have per-socket choices, it is > just an all-or-nothing choice. "2" isn't the only choice for number of SNC > nodes on a socket. "4" is (or will be) a choice. Yeah, in the arm world, partners get to make the decision on what is sane. Big-little means someone could do something that looks like SNC in on cluster, but not another. If we don't know what user-space needs it for, I'd prefer we don't expose it, just to avoid giving out rope to shoot ourselves in the foot with. Thanks, James
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index a0dc64a70d01..392e7a08d083 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -997,6 +997,14 @@ static int rdt_num_rmids_show(struct kernfs_open_file *of, return 0; } +static int rdt_snc_ways_show(struct kernfs_open_file *of, + struct seq_file *seq, void *v) +{ + seq_printf(seq, "%d\n", snc_ways); + + return 0; +} + static int rdt_mon_features_show(struct kernfs_open_file *of, struct seq_file *seq, void *v) { @@ -1451,6 +1459,13 @@ static struct rftype res_common_files[] = { .seq_show = rdt_num_rmids_show, .fflags = RF_MON_INFO, }, + { + .name = "snc_ways", + .mode = 0444, + .kf_ops = &rdtgroup_kf_single_ops, + .seq_show = rdt_snc_ways_show, + .fflags = RF_MON_INFO, + }, { .name = "cbm_mask", .mode = 0444,