x86/resctrl: Implement rename op for mon groups
authorPeter Newman <peternewman@google.com>
Wed, 19 Apr 2023 12:50:14 +0000 (14:50 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 7 Jun 2023 10:40:36 +0000 (12:40 +0200)
commit8da2b938eb7e2ef407b8ef99def12e3054a99645
tree6f8e023007081a7afc2b5e1649bc8f8346806154
parentc45c06d4ae63a0714efbfa435c5a8f64a5f35b9b
x86/resctrl: Implement rename op for mon groups

To change the resources allocated to a large group of tasks, such as an
application container, a container manager must write all of the tasks'
IDs into the tasks file interface of the new control group. This is
challenging when the container's task list is always changing.

In addition, if the container manager is using monitoring groups to
separately track the bandwidth of containers assigned to the same
control group, when moving a container, it must first move the
container's tasks to the default monitoring group of the new control
group before it can move these tasks into the container's replacement
monitoring group under the destination control group. This is
undesirable because it makes bandwidth usage during the move
unattributable to the correct tasks and resets monitoring event counters
and cache usage information for the group.

Implement the rename operation only for resctrlfs monitor groups to
enable users to move a monitoring group from one control group to
another. This effects a change in resources allocated to all the tasks
in the monitoring group while otherwise leaving the monitoring data
intact.

Signed-off-by: Peter Newman <peternewman@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Link: https://lore.kernel.org/r/20230419125015.693566-3-peternewman@google.com
arch/x86/kernel/cpu/resctrl/rdtgroup.c