Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1903322rdb; Thu, 7 Dec 2023 11:56:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMfECEUYE7z146CoPArHtjmqEf/H8SP+7FLW5VWd2CWWDjiDH7HV2OAa5LrQwiCm1ncjXr X-Received: by 2002:a17:903:244e:b0:1d0:6ffd:6e73 with SMTP id l14-20020a170903244e00b001d06ffd6e73mr2956574pls.107.1701979006813; Thu, 07 Dec 2023 11:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701979006; cv=none; d=google.com; s=arc-20160816; b=UAkkixgTSkfCzDD/KDkfYP4KpW3zkeCAqlLrx7sJhXzmmzCX6bghz8WnX0Y7TyEMA1 9YCa89o6n+qed6Jc5I9N1igAzE9TrAHAWTEaRXu+ak9GebW0y8Sp+FTsqUSr6YWj/tBL Hi/hxJ+YczTqf8UgCgo/BHbE4L1IxuDsq52Mq9roYaPjn8seJ1JvAChc9lftVIpA4YTm xgYFa0H3/zxe99X0tEEfCNksVuykL+axTT6Szf3DXZMDiZlpwWHAwb2XouXc7KnihhYw fz8hJCidp3J0g3buVhsNsM4wmLy2bhO4+IXLKEOFdWwoj8Qi4hdE6Zw9XVvoLVVoU9MP Pbng== 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 Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p17-20020a170902ead100b001d07b6a0aefsi254110pld.214.2023.12.07.11.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 11:56:46 -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 9D8A684E9899; Thu, 7 Dec 2023 11:56:42 -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 + 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 ); 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 To: Fenghua Yu , Reinette Chatre , Peter Newman , Jonathan Corbet , Shuah Khan , x86@kernel.org Cc: Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck 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: 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:42 -0800 (PST) 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 --- 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