[v6,2/3] x86/resctrl: Use total bandwidth for mba_MBps option when local isn't present
Message ID | 20231207195613.153980-3-tony.luck@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5028096vqy; Thu, 7 Dec 2023 11:56:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IET/bg+H3kU/hOaZcYX8T5c1lWx8+kR9upcK5FxtP1PClIGOupYZwTBDdi5MGgs3kzepIqh X-Received: by 2002:a17:90a:1911:b0:286:9464:1bcd with SMTP id 17-20020a17090a191100b0028694641bcdmr2872152pjg.43.1701978999353; Thu, 07 Dec 2023 11:56:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701978999; cv=none; d=google.com; s=arc-20160816; b=ofJjRsrePCXJ7TJEWAHa/gYouAyID+QxZYtnuwzo815+TAgeDdV9DIusEjjCSpgTpu eCKGnCvCCvblmz68st5RVf1MeMOhV1cZFUBzOhY6RIuPhOlRPg0jqpiHQ8HimZfURlyP uh4wjMczeN0kfLodufZLzCAfUwVu+z1FPuFmXbFHBam7F1TrkCP/4Yt0mktDY9CKaFES AQXY1vN9aQSt03VWE7GmyKfyTDcqpw90OdHRGFB+8H6nfIfncuRzY5Ors4istNHj5GGV O6rxSvhIKASI8HqlEQmwgDlVkWxON7mZc80beRTvl/xMecNZyprJhlxn9lfUI7UB2gm5 xxqg== 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=IEd2YABLoLoF5Maa2ibhVfChEgxF/ukbXFOEfsjrPso=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=wg/5G/foh5tAWOooexmn3bp1gBSfEuKTXNT+LARIm0oz8Fij10g2ZsvQTArEXhJNns pW3p6XKjFqWDMclFwCUK9gSmbj5vdkm4WN6Z2RmvJ1gQzHT8c4iF+KC8NDw4OQrHlakn 5m8L3K8f2HgdHS4rYvM+6BkS5NaGVJ6BXmcvQZe2+Wl0VNznJ0ndjtqY5FIsKdxMS9LU mxSPv/WK1iH+vdMGxiqXCiIqSgGWsPwpC+NgDWJnNos/4T018gR40HhAmIgsEcqkMefn TAaGcSoW8rtDFmDVPPZOkt1ssvS9+29Pey08zeBlfSLxF5m3a8bzIfDSwf13rPXCio9l 55KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SzfyP099; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id g12-20020a17090a714c00b00286ce76ff01si265396pjs.146.2023.12.07.11.56.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 11:56:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SzfyP099; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 4D48D84E9896; Thu, 7 Dec 2023 11:56:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443836AbjLGT4V (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Thu, 7 Dec 2023 14:56:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbjLGT4T (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 7 Dec 2023 14:56:19 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 951F0170E; Thu, 7 Dec 2023 11:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701978985; x=1733514985; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t5VxIPCjhEqavPh7wbXuE5TbTXLyEI0R+msiZrynqtw=; b=SzfyP099vvvRJFc4KfKN3wteZH8Dx0gSBg2NorFoiB9GNl2g375YxCB7 5GDm+FS48EEbZxRqWOff/P1mBT5StSViJkKSHw24bzayciA/FWx2MX/fE 4ZHK6YMeC0+l7CqQN93FVSbb0CibahsRR8hwS6t78Y725NWnV1jQfWMtl HFtf3wR10ltukZIWEHIY/2Lm4dWUuiIOMVkzRD+DXkn3T2QFGKy+qZf7+ IZuhlKXQuuTv/JKHaSlUuQjb1n0jPM+t91Z+zVu9F2ZZP1bEEKyl1e6lJ n47/WrPa/O/ySW0R/mHoc5qK74ctWB/Z0ZoNmmrH8RT+cDQnJnpKeBj9X Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="15848966" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="15848966" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 11:56:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="889858593" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="889858593" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 11:56:23 -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>, Shuah Khan <skhan@linuxfoundation.org>, 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>, Randy Dunlap <rdunlap@infradead.org>, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck <tony.luck@intel.com> Subject: [PATCH v6 2/3] x86/resctrl: Use total bandwidth for mba_MBps option when local isn't present Date: Thu, 7 Dec 2023 11:56:12 -0800 Message-ID: <20231207195613.153980-3-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231207195613.153980-1-tony.luck@intel.com> References: <20231201214737.104444-1-tony.luck@intel.com> <20231207195613.153980-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 11:56:33 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784654331513375554 X-GMAIL-MSGID: 1784654331513375554 |
Series |
x86/resctrl: mba_MBps enhancements
|
|
Commit Message
Luck, Tony
Dec. 7, 2023, 7:56 p.m. UTC
On Intel systems the memory bandwidth monitoring events are
independently enumerated. It is possible for a system to support
total memory bandwidth monitoring, but not support local bandwidth
monitoring. On such a system a user could not enable mba_sc mode.
Users will see this highly unhelpful error message from mount:
# mount -t resctrl -o mba_MBps resctrl /sys/fs/resctrl
mount: /sys/fs/resctrl: wrong fs type, bad option, bad superblock on
resctrl, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
dmesg(1) does not provide any additional information.
Modify the existing "mba_MBps" mount option to switch to total bandwidth
monitoring if local monitoring is not available.
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Thu, Dec 7, 2023 at 11:56 AM Tony Luck <tony.luck@intel.com> wrote: > > On Intel systems the memory bandwidth monitoring events are > independently enumerated. It is possible for a system to support > total memory bandwidth monitoring, but not support local bandwidth > monitoring. On such a system a user could not enable mba_sc mode. > Users will see this highly unhelpful error message from mount: > > # mount -t resctrl -o mba_MBps resctrl /sys/fs/resctrl > mount: /sys/fs/resctrl: wrong fs type, bad option, bad superblock on > resctrl, missing codepage or helper program, or other error. > dmesg(1) may have more information after failed mount system call. > > dmesg(1) does not provide any additional information. > > Modify the existing "mba_MBps" mount option to switch to total bandwidth > monitoring if local monitoring is not available. > > Signed-off-by: Tony Luck <tony.luck@intel.com> > --- > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 5f64a0b2597c..7410513db45a 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -2725,6 +2725,8 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) > return -EINVAL; > if (is_mbm_local_enabled()) > ctx->enable_mba_mbps_local = true; > + else if (is_mbm_total_enabled()) > + ctx->enable_mba_mbps_total = true; > else > return -EINVAL; > return 0; > -- > 2.41.0 > Reviewed-by: Peter Newman <peternewman@google.com>
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 5f64a0b2597c..7410513db45a 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2725,6 +2725,8 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) return -EINVAL; if (is_mbm_local_enabled()) ctx->enable_mba_mbps_local = true; + else if (is_mbm_total_enabled()) + ctx->enable_mba_mbps_total = true; else return -EINVAL; return 0;