Hi Reinette,
On 8/28/2025 9:47 PM, Reinette Chatre wrote:
Hi Babu,
On 8/27/25 1:39 PM, Moger, Babu wrote:
On 8/22/25 17:53, Moger, Babu wrote:
On 8/7/2025 8:49 PM, Reinette Chatre wrote:
On 8/5/25 4:30 PM, Babu Moger wrote:
+ enum resctrl_conf_type peer_type;
+ struct resctrl_schema *peer_s;
+ int ret;
+
+ rdt_staged_configs_clear();
+
+ ret = rdtgroup_init_cat(s, closid);
+ if (ret < 0)
+ goto out;
+
+ /* Initialize schema for both CDP_DATA and CDP_CODE when CDP is
enabled */
+ if (resctrl_arch_get_cdp_enabled(r->rid)) {
+ peer_type = resctrl_peer_type(s->conf_type);
+ peer_s = resctrl_get_schema(peer_type);
+ if (peer_s) {
+ ret = rdtgroup_init_cat(peer_s, closid);
This is unexpected. In v7 I suggested that when parsing the CBM of one
of the CDP
resources it is not necessary to do so again for the peer. The CBM can be
parsed *once* and the configuration just copied over. See:
https://lore.kernel.org/
lkml/82045638-2b26-4682-9374-1c3e400a580a@xxxxxxxxx/
Let met try to understand.
So, rdtgroup_init_cat() sets up the staged _config for the specific CDP
type for all the domains.
We need to apply those staged_configs to its peer type on all the domains.
To put it more directly, this implementation keeps the CBM of CDP_CODE and
CDP_DATA in sync. Skipping the unnecessary and duplicate parsing and instead
copying the CBM from one to the other makes that obvious.
Got it.
Something like this?
/* Initialize staged_config of the peer type when CDP is enabled */
if (resctrl_arch_get_cdp_enabled(r->rid)) {
list_for_each_entry(d, &s->res->ctrl_domains, hdr.list) {
cfg = &d->staged_config[s->conf_type];
cfg_peer = &d->staged_config[peer_type];
cfg_peer->new_ctrl = cfg->new_ctrl;
cfg_peer->have_new_ctrl = cfg->have_new_ctrl;
}
}
Replaced with following snippet.
/* Initialize schema for both CDP_DATA and CDP_CODE when CDP is enabled */
Could this be more specific? For example,
"Keep CDP_CODE and CDP_DATA of io_alloc CLOSID's CBM in sync."
Sure.
+ if (resctrl_arch_get_cdp_enabled(r->rid)) {
+ peer_type = resctrl_peer_type(s->conf_type);
+ list_for_each_entry(d, &s->res->ctrl_domains, hdr.list)
+ memcpy(&d->staged_config[peer_type],
+ &d->staged_config[s->conf_type],
+ sizeof(*d->staged_config));
This looks good to me. To make it obvious what types are dealt with this
can instead use sizeof(d->staged_config[0]).
Sure. Thanks
Babu