[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e1471a0-3484-4273-9be7-94d084d2cc4d@intel.com>
Date: Thu, 19 Dec 2024 19:12:27 -0800
From: Reinette Chatre <reinette.chatre@...el.com>
To: Babu Moger <babu.moger@....com>, <corbet@....net>, <tglx@...utronix.de>,
<mingo@...hat.com>, <bp@...en8.de>, <dave.hansen@...ux.intel.com>,
<tony.luck@...el.com>, <peternewman@...gle.com>
CC: <fenghua.yu@...el.com>, <x86@...nel.org>, <hpa@...or.com>,
<paulmck@...nel.org>, <akpm@...ux-foundation.org>, <thuth@...hat.com>,
<rostedt@...dmis.org>, <xiongwei.song@...driver.com>,
<pawan.kumar.gupta@...ux.intel.com>, <daniel.sneddon@...ux.intel.com>,
<jpoimboe@...nel.org>, <perry.yuan@....com>, <andipan.das@....com>,
<kai.huang@...el.com>, <xiaoyao.li@...el.com>, <seanjc@...gle.com>,
<xin3.li@...el.com>, <andrew.cooper3@...rix.com>, <ebiggers@...gle.com>,
<mario.limonciello@....com>, <james.morse@....com>,
<tan.shaopeng@...itsu.com>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <maciej.wieczor-retman@...el.com>,
<eranian@...gle.com>
Subject: Re: [PATCH v10 22/24] x86/resctrl: Update assignments on event
configuration changes
Hi Babu,
On 12/12/24 12:15 PM, Babu Moger wrote:
> Resctrl provides option to configure events by writing to the interfaces
> /sys/fs/resctrl/info/L3_MON/mbm_total_bytes_config or
> /sys/fs/resctrl/info/L3_MON/mbm_local_bytes_config when BMEC (Bandwidth
> Monitoring Event Configuration) is supported.
>
> Whenever the event configuration is updated, MBM assignments must be
> revised across all monitor groups within the impacted domains.
This needs imperative tone description of what this patch does.
...
> @@ -1825,6 +1825,54 @@ static int mbm_local_bytes_config_show(struct kernfs_open_file *of,
> return 0;
> }
>
> +/*
> + * Review the cntr_cfg domain configuration. If a matching assignment is found,
> + * update the counter assignment accordingly. This is within the IPI Context,
This "Review the cntr_cfg domain configuration. If a matching assignment is found,"
is too vague for me to make sense of what it is trying to do. Can this be made more specific?
> + * so call resctrl_abmc_config_one_amd directly.
> + */
> +static void resctrl_arch_update_cntr(struct rdt_resource *r, struct rdt_mon_domain *d,
> + enum resctrl_event_id evtid, u32 val)
> +{
> + struct cntr_config config;
> + struct rdtgroup *rdtgrp;
> + struct mbm_state *m;
> + u32 cntr_id;
> +
> + for (cntr_id = 0; cntr_id < r->mon.num_mbm_cntrs; cntr_id++) {
> + rdtgrp = d->cntr_cfg[cntr_id].rdtgrp;
> + if (rdtgrp && d->cntr_cfg[cntr_id].evtid == evtid) {
> + memset(&config, 0, sizeof(struct cntr_config));
> + config.r = r;
> + config.d = d;
> + config.evtid = evtid;
> + config.rmid = rdtgrp->mon.rmid;
> + config.closid = rdtgrp->closid;
> + config.cntr_id = cntr_id;
> + config.val = val;
> + config.assign = 1;
> +
> + resctrl_abmc_config_one_amd(&config);
> +
> + m = get_mbm_state(d, rdtgrp->closid, rdtgrp->mon.rmid, evtid);
> + if (m)
> + memset(m, 0, sizeof(struct mbm_state));
> + }
> + }
> +}
> +
> +static void resctrl_mon_event_config_set(void *info)
> +{
> + struct mon_config_info *mon_info = info;
> + struct rdt_mon_domain *d = mon_info->d;
> + struct rdt_resource *r = mon_info->r;
> +
> + resctrl_arch_mon_event_config_set(d, mon_info->evtid, mon_info->mon_config);
> +
> + /* Check if assignments needs to be updated */
> + if (resctrl_arch_mbm_cntr_assign_enabled(r))
> + resctrl_arch_update_cntr(r, d, mon_info->evtid,
> + mon_info->mon_config);
> +}
>
> static void mbm_config_write_domain(struct rdt_resource *r,
> struct rdt_mon_domain *d, u32 evtid, u32 val)
> @@ -1840,6 +1888,7 @@ static void mbm_config_write_domain(struct rdt_resource *r,
> if (config_val == INVALID_CONFIG_VALUE || config_val == val)
> return;
>
> + mon_info.r = r;
> mon_info.d = d;
> mon_info.evtid = evtid;
> mon_info.mon_config = val;
> @@ -1851,7 +1900,7 @@ static void mbm_config_write_domain(struct rdt_resource *r,
> * on one CPU is observed by all the CPUs in the domain.
> */
> smp_call_function_any(&d->hdr.cpu_mask,
> - resctrl_arch_mon_event_config_set,
> + resctrl_mon_event_config_set,
> &mon_info, 1);
>
> /*
Reinette
Powered by blists - more mailing lists