From nobody Wed Dec 17 06:46:03 2025 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 CE739C4167B for ; Thu, 7 Dec 2023 19:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443870AbjLGT41 (ORCPT ); Thu, 7 Dec 2023 14:56:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233106AbjLGT4T (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 7FA9E10F7; 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=rzvL5k6M1nGqaS/TBlqP4ZQ+wAzLxV/e2Y2+OAMN5qA=; b=U0c69NoCTRmb07TMKW9YKtyYz6WF5lFrAYUv+G/JPZZ+V+L+DlB6ybTG Dca+XL+ca3Ws/LVJVP5IGuvRXL6EV2t8sTYFip1s/qQlkx55JbeAn42Mo TTZ/aAJQ+LtIsx5vx+msRX3fA1elQEp7RGitW0r/oiS8BwRi3HqyDW8s0 HxUGJ3EH22Luc4AJZgnOC5w0u3q9SRAtcYZSmXplibyfbblJaq0QKXWkC zyh/wblcBuFCtv1x/f+tMkouvUYTT+EZGfOHPAz5YrhBh+IF9qB5fOFPF S/YLuNmeDpsj6znkoNZSTeERstAaAWunY5YJnabbqc+KkEe8M75lyIgmo w==; X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="15848949" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="15848949" 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:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="889858590" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="889858590" 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 1/3] x86/resctrl: Add mount option "mba_MBps_event" Date: Thu, 7 Dec 2023 11:56:11 -0800 Message-ID: <20231207195613.153980-2-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The MBA Software Controller(mba_sc) is a feedback loop that uses measurements of local memory bandwidth to adjust MBA throttling levels to keep workloads in a resctrl group within a target bandwidth set in the schemata file. Users may want to use total memory bandwidth instead of local to handle workloads that have poor NUMA localization. Add a new mount option "mba_MBps_event=3D{event_name}" where event_name is one of "mbm_Local_bytes" or "mbm_total_bytes" that allows a user to specify which monitoring event to use. Update the once-per-second polling code to use the chosen event (local or total memory bandwidth). Signed-off-by: Tony Luck Reviewed-by: Peter Newman --- include/linux/resctrl.h | 2 + arch/x86/kernel/cpu/resctrl/internal.h | 3 +- arch/x86/kernel/cpu/resctrl/monitor.c | 21 +++++---- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 61 +++++++++++++++++++++----- 4 files changed, 63 insertions(+), 24 deletions(-) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 66942d7fba7f..1feb3b2e64fa 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -129,6 +129,7 @@ enum membw_throttle_mode { * @throttle_mode: Bandwidth throttling mode when threads request * different memory bandwidths * @mba_sc: True if MBA software controller(mba_sc) is enabled + * @mba_mbps_event: Event (local or total) for mba_sc * @mb_map: Mapping of memory B/W percentage to memory B/W delay */ struct resctrl_membw { @@ -138,6 +139,7 @@ struct resctrl_membw { bool arch_needs_linear; enum membw_throttle_mode throttle_mode; bool mba_sc; + enum resctrl_event_id mba_mbps_event; u32 *mb_map; }; =20 diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/r= esctrl/internal.h index a4f1aa15f0a2..8b9b8f664324 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -58,7 +58,8 @@ struct rdt_fs_context { struct kernfs_fs_context kfc; bool enable_cdpl2; bool enable_cdpl3; - bool enable_mba_mbps; + bool enable_mba_mbps_local; + bool enable_mba_mbps_total; bool enable_debug; }; =20 diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/re= sctrl/monitor.c index f136ac046851..d9e590f1cbc3 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -431,9 +431,10 @@ static int __mon_event_count(u32 rmid, struct rmid_rea= d *rr) */ static void mbm_bw_count(u32 rmid, struct rmid_read *rr) { - struct mbm_state *m =3D &rr->d->mbm_local[rmid]; u64 cur_bw, bytes, cur_bytes; + struct mbm_state *m; =20 + m =3D get_mbm_state(rr->d, rmid, rr->evtid); cur_bytes =3D rr->val; bytes =3D cur_bytes - m->prev_bw_bytes; m->prev_bw_bytes =3D cur_bytes; @@ -521,19 +522,21 @@ static void update_mba_bw(struct rdtgroup *rgrp, stru= ct rdt_domain *dom_mbm) u32 closid, rmid, cur_msr_val, new_msr_val; struct mbm_state *pmbm_data, *cmbm_data; u32 cur_bw, delta_bw, user_bw; + enum resctrl_event_id evt_id; struct rdt_resource *r_mba; struct rdt_domain *dom_mba; struct list_head *head; struct rdtgroup *entry; =20 - if (!is_mbm_local_enabled()) + if (!is_mbm_enabled()) return; =20 r_mba =3D &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl; + evt_id =3D r_mba->membw.mba_mbps_event; =20 closid =3D rgrp->closid; rmid =3D rgrp->mon.rmid; - pmbm_data =3D &dom_mbm->mbm_local[rmid]; + pmbm_data =3D get_mbm_state(dom_mbm, rmid, evt_id); =20 dom_mba =3D get_domain_from_cpu(smp_processor_id(), r_mba); if (!dom_mba) { @@ -553,7 +556,7 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct= rdt_domain *dom_mbm) */ head =3D &rgrp->mon.crdtgrp_list; list_for_each_entry(entry, head, mon.crdtgrp_list) { - cmbm_data =3D &dom_mbm->mbm_local[entry->mon.rmid]; + cmbm_data =3D get_mbm_state(dom_mbm, entry->mon.rmid, evt_id); cur_bw +=3D cmbm_data->prev_bw; delta_bw +=3D cmbm_data->delta_bw; } @@ -616,18 +619,14 @@ static void mbm_update(struct rdt_resource *r, struct= rdt_domain *d, int rmid) rr.evtid =3D QOS_L3_MBM_TOTAL_EVENT_ID; rr.val =3D 0; __mon_event_count(rmid, &rr); + if (is_mba_sc(NULL) && rr.evtid =3D=3D r->membw.mba_mbps_event) + mbm_bw_count(rmid, &rr); } if (is_mbm_local_enabled()) { rr.evtid =3D QOS_L3_MBM_LOCAL_EVENT_ID; rr.val =3D 0; __mon_event_count(rmid, &rr); - - /* - * Call the MBA software controller only for the - * control groups and when user has enabled - * the software controller explicitly. - */ - if (is_mba_sc(NULL)) + if (is_mba_sc(NULL) && rr.evtid =3D=3D r->membw.mba_mbps_event) mbm_bw_count(rmid, &rr); } } diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/r= esctrl/rdtgroup.c index 69a1de92384a..5f64a0b2597c 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2294,7 +2294,7 @@ static bool supports_mba_mbps(void) { struct rdt_resource *r =3D &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl; =20 - return (is_mbm_local_enabled() && + return (is_mbm_enabled() && r->alloc_capable && is_mba_linear()); } =20 @@ -2302,7 +2302,7 @@ static bool supports_mba_mbps(void) * Enable or disable the MBA software controller * which helps user specify bandwidth in MBps. */ -static int set_mba_sc(bool mba_sc) +static int set_mba_sc(bool mba_sc, enum resctrl_event_id mba_mbps_event) { struct rdt_resource *r =3D &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl; u32 num_closid =3D resctrl_arch_get_num_closid(r); @@ -2313,6 +2313,7 @@ static int set_mba_sc(bool mba_sc) return -EINVAL; =20 r->membw.mba_sc =3D mba_sc; + r->membw.mba_mbps_event =3D mba_mbps_event; =20 list_for_each_entry(d, &r->domains, list) { for (i =3D 0; i < num_closid; i++) @@ -2445,13 +2446,14 @@ static void rdt_disable_ctx(void) { resctrl_arch_set_cdp_enabled(RDT_RESOURCE_L3, false); resctrl_arch_set_cdp_enabled(RDT_RESOURCE_L2, false); - set_mba_sc(false); + set_mba_sc(false, QOS_L3_MBM_LOCAL_EVENT_ID); =20 resctrl_debug =3D false; } =20 static int rdt_enable_ctx(struct rdt_fs_context *ctx) { + enum resctrl_event_id mba_mbps_event; int ret =3D 0; =20 if (ctx->enable_cdpl2) { @@ -2466,8 +2468,12 @@ static int rdt_enable_ctx(struct rdt_fs_context *ctx) goto out_cdpl2; } =20 - if (ctx->enable_mba_mbps) { - ret =3D set_mba_sc(true); + if (ctx->enable_mba_mbps_local || ctx->enable_mba_mbps_total) { + if (ctx->enable_mba_mbps_total) + mba_mbps_event =3D QOS_L3_MBM_TOTAL_EVENT_ID; + else + mba_mbps_event =3D QOS_L3_MBM_LOCAL_EVENT_ID; + ret =3D set_mba_sc(true, mba_mbps_event); if (ret) goto out_cdpl3; } @@ -2683,15 +2689,17 @@ enum rdt_param { Opt_cdp, Opt_cdpl2, Opt_mba_mbps, + Opt_mba_mbps_event, Opt_debug, nr__rdt_params }; =20 static const struct fs_parameter_spec rdt_fs_parameters[] =3D { - fsparam_flag("cdp", Opt_cdp), - fsparam_flag("cdpl2", Opt_cdpl2), - fsparam_flag("mba_MBps", Opt_mba_mbps), - fsparam_flag("debug", Opt_debug), + fsparam_flag("cdp", Opt_cdp), + fsparam_flag("cdpl2", Opt_cdpl2), + fsparam_flag("mba_MBps", Opt_mba_mbps), + fsparam_string("mba_MBps_event", Opt_mba_mbps_event), + fsparam_flag("debug", Opt_debug), {} }; =20 @@ -2715,7 +2723,25 @@ static int rdt_parse_param(struct fs_context *fc, st= ruct fs_parameter *param) case Opt_mba_mbps: if (!supports_mba_mbps()) return -EINVAL; - ctx->enable_mba_mbps =3D true; + if (is_mbm_local_enabled()) + ctx->enable_mba_mbps_local =3D true; + else + return -EINVAL; + return 0; + case Opt_mba_mbps_event: + if (!supports_mba_mbps()) + return -EINVAL; + if (!strcmp("mbm_local_bytes", param->string)) { + if (!is_mbm_local_enabled()) + return -EINVAL; + ctx->enable_mba_mbps_local =3D true; + } else if (!strcmp("mbm_total_bytes", param->string)) { + if (!is_mbm_total_enabled()) + return -EINVAL; + ctx->enable_mba_mbps_total =3D true; + } else { + return -EINVAL; + } return 0; case Opt_debug: ctx->enable_debug =3D true; @@ -3780,16 +3806,27 @@ static int rdtgroup_rename(struct kernfs_node *kn, return ret; } =20 +static char *mba_sc_event_opt_name(struct rdt_resource *r) +{ + if (r->membw.mba_mbps_event =3D=3D QOS_L3_MBM_LOCAL_EVENT_ID) + return ",mba_MBps_event=3Dmbm_local_bytes"; + else if (r->membw.mba_mbps_event =3D=3D QOS_L3_MBM_TOTAL_EVENT_ID) + return ",mba_MBps_event=3Dmbm_total_bytes"; + return ""; +} + static int rdtgroup_show_options(struct seq_file *seq, struct kernfs_root = *kf) { + struct rdt_resource *r_mba =3D &rdt_resources_all[RDT_RESOURCE_MBA].r_res= ctrl; + if (resctrl_arch_get_cdp_enabled(RDT_RESOURCE_L3)) seq_puts(seq, ",cdp"); =20 if (resctrl_arch_get_cdp_enabled(RDT_RESOURCE_L2)) seq_puts(seq, ",cdpl2"); =20 - if (is_mba_sc(&rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl)) - seq_puts(seq, ",mba_MBps"); + if (is_mba_sc(r_mba)) + seq_puts(seq, mba_sc_event_opt_name(r_mba)); =20 if (resctrl_debug) seq_puts(seq, ",debug"); --=20 2.41.0 From nobody Wed Dec 17 06:46:03 2025 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 54360C4167B for ; Thu, 7 Dec 2023 19:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443850AbjLGT4X (ORCPT ); Thu, 7 Dec 2023 14:56:23 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Peter Newman --- 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/r= esctrl/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, str= uct fs_parameter *param) return -EINVAL; if (is_mbm_local_enabled()) ctx->enable_mba_mbps_local =3D true; + else if (is_mbm_total_enabled()) + ctx->enable_mba_mbps_total =3D true; else return -EINVAL; return 0; --=20 2.41.0 From nobody Wed Dec 17 06:46:03 2025 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 34B1DC10DCE for ; Thu, 7 Dec 2023 19:56:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443864AbjLGT4Z (ORCPT ); Thu, 7 Dec 2023 14:56:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233115AbjLGT4U (ORCPT ); Thu, 7 Dec 2023 14:56:20 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68ECF170F; Thu, 7 Dec 2023 11:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701978986; x=1733514986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7Y+W1l2QvxVLq3YI3AbXljtPrGo+7Qw1R28SArBOmbk=; b=KJRUJPTPm4Vl80uWPmSXEmxulAoj3j/TGEKecYavYOpMoYirsraIZ2rG i2wkKa0uPioAOcYtwEHZNqVZdXV3bpYmK1tF707UOSptVJTGoWnsZzIbe V3THq/Kfp/i779XtWiPBiIT4VWLNzqUs/hTFciGp/CiNyYZIE+7a4GZBH k/zWafEgTbjrr7SPAr71Mct+I2MDmAIk4tlNdk/FUL02wpK124g0Nbzmu kUetYjmi0KIVJ6oCeQ6OvMrx8ao1v0EEu5x9WeZbFwixKBk4x/RGimNzW OAtwVjmKIQQWtU5KypD857yQYFFQ7eXHh5fGo3hjbiKUJtc74RO9np6ER w==; X-IronPort-AV: E=McAfee;i="6600,9927,10917"; a="15848980" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="15848980" 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="889858596" X-IronPort-AV: E=Sophos;i="6.04,258,1695711600"; d="scan'208";a="889858596" 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:24 -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 3/3] x86/resctrl: Add new "mba_MBps_event" mount option to documentation Date: Thu, 7 Dec 2023 11:56:13 -0800 Message-ID: <20231207195613.153980-4-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" New mount option may be used to choose a specific memory bandwidth monitoring event to feed the MBA Software Controller(mba_sc) feedback loop. Signed-off-by: Tony Luck Reviewed-by: Peter Newman --- Documentation/arch/x86/resctrl.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/re= sctrl.rst index a6279df64a9d..a0c521db6786 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -35,7 +35,8 @@ about the feature from resctrl's info directory. =20 To use the feature mount the file system:: =20 - # mount -t resctrl resctrl [-o cdp[,cdpl2][,mba_MBps][,debug]] /sys/fs/re= sctrl + # mount -t resctrl resctrl [-o cdp[,cdpl2][,mba_MBps] \ + [,mba_MBps_event=3D[mbm_local_bytes|mbm_total_bytes]][,debug]] /sys/fs/re= sctrl =20 mount options are: =20 @@ -45,7 +46,12 @@ mount options are: Enable code/data prioritization in L2 cache allocations. "mba_MBps": Enable the MBA Software Controller(mba_sc) to specify MBA - bandwidth in MBps + bandwidth in MBps. Defaults to using MBM local bandwidth, + but will use total bandwidth on systems that do not support + local bandwidth monitoring. +"mba_MBps_event=3D[mbm_local_bytes|mbm_total_bytes]": + Enable the MBA Software Controller(mba_sc) with a specific + MBM event as input to the feedback loop. "debug": Make debug files accessible. Available debug files are annotated with "Available only with debug option". @@ -538,6 +544,12 @@ where as user can switch to the "MBA software controll= er" mode using a mount option 'mba_MBps'. The schemata format is specified in the below sections. =20 +By default the software feedback mechanism uses measurement of local +memory bandwidth to make adjustments to throttling levels. If a system +is running applications with poor NUMA locality users may want to use +the "mba_MBps_event=3Dmbm_total_bytes" mount option which will use total +memory bandwidth measurements instead of local. + L3 schemata file details (code and data prioritization disabled) ---------------------------------------------------------------- With CDP disabled the L3 schemata format is:: --=20 2.41.0