2023-04-19 12:53:04

by Peter Newman

[permalink] [raw]
Subject: [PATCH v6 0/3] x86/resctrl: Implement rename to help move containers' tasks

Hi Reinette, Fenghua,

This patch series implements the solution Reinette suggested in the
earlier RFD thread[1] for the problem of moving a container's tasks to a
different control group on systems that don't provide enough CLOSIDs to
give every container its own control group.

This patch series assumes that a MON group's CLOSID can simply be
changed to that of a new parent CTRL_MON group. This is allowed on Intel
and AMD, but not MPAM implementations. While we (Google) only foresee
needing this functionality on Intel and AMD systems, this series should
hopefully be a good starting point for supporting MPAM.

Thanks!
-Peter

Updates:

v6:
- rebase to v6.3-rc7
- clarify changelog wording
- clarify error message for non-directory move
- remove unneeded parenthesis for checkpatch.pl --strict
- add Reviewed-By's from Reinette

v5:
- rebase to v6.3-rc4
- dropped rdt_move_group_tasks() task filter patch
- code/comment clarifications and errno updates requested by Reinette
- added Documentation patch

v4:
- rebase to v6.2
- commit message updates suggested by Reinette
- replace rdt_move_one_task() patch with rdt_move_group_tasks() filter
function patch
- prevent rename on files or renaming to "mon_groups"
- optimize simple rename case
- disallow renaming groups with non-empty cpumask
- ensure source is a proper MON group directory
- fix missing rdtgrp->closid update
- add more last_command_status output

v3: use revised task CLOSID/RMID update IPI sync method from [3]
v2: reworded change logs based on what I've learned from review comments
in another patch series[2]

[v1] https://lore.kernel.org/lkml/[email protected]/
[v2] https://lore.kernel.org/lkml/[email protected]/
[v3] https://lore.kernel.org/lkml/[email protected]/
[v4] https://lore.kernel.org/lkml/[email protected]/
[v5] https://lore.kernel.org/lkml/[email protected]/

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/
[3] https://lore.kernel.org/lkml/[email protected]/

Peter Newman (3):
x86/resctrl: Factor rdtgroup lock for multi-file ops
x86/resctrl: Implement rename op for mon groups
Documentation/x86: Documentation for MON group move feature

Documentation/x86/resctrl.rst | 7 ++
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 163 +++++++++++++++++++++++--
2 files changed, 157 insertions(+), 13 deletions(-)


base-commit: 6a8f57ae2eb07ab39a6f0ccad60c760743051026
--
2.40.0.634.g4ca3ef3211-goog


2023-04-19 12:53:29

by Peter Newman

[permalink] [raw]
Subject: [PATCH v6 3/3] Documentation/x86: Documentation for MON group move feature

Describe new support for moving MON groups to a new parent CTRL_MON
group and its restrictions.

Signed-off-by: Peter Newman <[email protected]>
Reviewed-by: Reinette Chatre <[email protected]>
---
Documentation/x86/resctrl.rst | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/x86/resctrl.rst b/Documentation/x86/resctrl.rst
index 387ccbcb558f..cb05d90111b4 100644
--- a/Documentation/x86/resctrl.rst
+++ b/Documentation/x86/resctrl.rst
@@ -287,6 +287,13 @@ Removing a directory will move all tasks and cpus owned by the group it
represents to the parent. Removing one of the created CTRL_MON groups
will automatically remove all MON groups below it.

+Moving MON group directories to a new parent CTRL_MON group is supported
+for the purpose of changing the resource allocations of a MON group
+without impacting its monitoring data or assigned tasks. This operation
+is not allowed for MON groups which monitor CPUs. No other move
+operation is currently allowed other than simply renaming a CTRL_MON or
+MON group.
+
All groups contain the following files:

"tasks":
--
2.40.0.634.g4ca3ef3211-goog

2023-05-03 15:01:52

by Moger, Babu

[permalink] [raw]
Subject: Re: [PATCH v6 0/3] x86/resctrl: Implement rename to help move containers' tasks

Tested the series. Looks good.

Tested-by: Babu Moger <[email protected]>

On 4/19/23 07:50, Peter Newman wrote:
> Hi Reinette, Fenghua,
>
> This patch series implements the solution Reinette suggested in the
> earlier RFD thread[1] for the problem of moving a container's tasks to a
> different control group on systems that don't provide enough CLOSIDs to
> give every container its own control group.
>
> This patch series assumes that a MON group's CLOSID can simply be
> changed to that of a new parent CTRL_MON group. This is allowed on Intel
> and AMD, but not MPAM implementations. While we (Google) only foresee
> needing this functionality on Intel and AMD systems, this series should
> hopefully be a good starting point for supporting MPAM.
>
> Thanks!
> -Peter
>
> Updates:
>
> v6:
> - rebase to v6.3-rc7
> - clarify changelog wording
> - clarify error message for non-directory move
> - remove unneeded parenthesis for checkpatch.pl --strict
> - add Reviewed-By's from Reinette
>
> v5:
> - rebase to v6.3-rc4
> - dropped rdt_move_group_tasks() task filter patch
> - code/comment clarifications and errno updates requested by Reinette
> - added Documentation patch
>
> v4:
> - rebase to v6.2
> - commit message updates suggested by Reinette
> - replace rdt_move_one_task() patch with rdt_move_group_tasks() filter
> function patch
> - prevent rename on files or renaming to "mon_groups"
> - optimize simple rename case
> - disallow renaming groups with non-empty cpumask
> - ensure source is a proper MON group directory
> - fix missing rdtgrp->closid update
> - add more last_command_status output
>
> v3: use revised task CLOSID/RMID update IPI sync method from [3]
> v2: reworded change logs based on what I've learned from review comments
> in another patch series[2]
>
> [v1] https://lore.kernel.org/lkml/[email protected]/
> [v2] https://lore.kernel.org/lkml/[email protected]/
> [v3] https://lore.kernel.org/lkml/[email protected]/
> [v4] https://lore.kernel.org/lkml/[email protected]/
> [v5] https://lore.kernel.org/lkml/[email protected]/
>
> [1] https://lore.kernel.org/lkml/[email protected]/
> [2] https://lore.kernel.org/lkml/[email protected]/
> [3] https://lore.kernel.org/lkml/[email protected]/
>
> Peter Newman (3):
> x86/resctrl: Factor rdtgroup lock for multi-file ops
> x86/resctrl: Implement rename op for mon groups
> Documentation/x86: Documentation for MON group move feature
>
> Documentation/x86/resctrl.rst | 7 ++
> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 163 +++++++++++++++++++++++--
> 2 files changed, 157 insertions(+), 13 deletions(-)
>
>
> base-commit: 6a8f57ae2eb07ab39a6f0ccad60c760743051026

--
Thanks
Babu Moger

2023-06-01 21:48:53

by Reinette Chatre

[permalink] [raw]
Subject: Re: [PATCH v6 0/3] x86/resctrl: Implement rename to help move containers' tasks

Hi x86 Maintainers,

Could you please consider this series for inclusion?

Thank you very much

Reinette


On 5/3/2023 7:50 AM, Moger, Babu wrote:
> Tested the series. Looks good.
>
> Tested-by: Babu Moger <[email protected]>
>
> On 4/19/23 07:50, Peter Newman wrote:
>> Hi Reinette, Fenghua,
>>
>> This patch series implements the solution Reinette suggested in the
>> earlier RFD thread[1] for the problem of moving a container's tasks to a
>> different control group on systems that don't provide enough CLOSIDs to
>> give every container its own control group.
>>
>> This patch series assumes that a MON group's CLOSID can simply be
>> changed to that of a new parent CTRL_MON group. This is allowed on Intel
>> and AMD, but not MPAM implementations. While we (Google) only foresee
>> needing this functionality on Intel and AMD systems, this series should
>> hopefully be a good starting point for supporting MPAM.
>>
>> Thanks!
>> -Peter
>>
>> Updates:
>>
>> v6:
>> - rebase to v6.3-rc7
>> - clarify changelog wording
>> - clarify error message for non-directory move
>> - remove unneeded parenthesis for checkpatch.pl --strict
>> - add Reviewed-By's from Reinette
>>
>> v5:
>> - rebase to v6.3-rc4
>> - dropped rdt_move_group_tasks() task filter patch
>> - code/comment clarifications and errno updates requested by Reinette
>> - added Documentation patch
>>
>> v4:
>> - rebase to v6.2
>> - commit message updates suggested by Reinette
>> - replace rdt_move_one_task() patch with rdt_move_group_tasks() filter
>> function patch
>> - prevent rename on files or renaming to "mon_groups"
>> - optimize simple rename case
>> - disallow renaming groups with non-empty cpumask
>> - ensure source is a proper MON group directory
>> - fix missing rdtgrp->closid update
>> - add more last_command_status output
>>
>> v3: use revised task CLOSID/RMID update IPI sync method from [3]
>> v2: reworded change logs based on what I've learned from review comments
>> in another patch series[2]
>>
>> [v1] https://lore.kernel.org/lkml/[email protected]/
>> [v2] https://lore.kernel.org/lkml/[email protected]/
>> [v3] https://lore.kernel.org/lkml/[email protected]/
>> [v4] https://lore.kernel.org/lkml/[email protected]/
>> [v5] https://lore.kernel.org/lkml/[email protected]/
>>
>> [1] https://lore.kernel.org/lkml/[email protected]/
>> [2] https://lore.kernel.org/lkml/[email protected]/
>> [3] https://lore.kernel.org/lkml/[email protected]/
>>
>> Peter Newman (3):
>> x86/resctrl: Factor rdtgroup lock for multi-file ops
>> x86/resctrl: Implement rename op for mon groups
>> Documentation/x86: Documentation for MON group move feature
>>
>> Documentation/x86/resctrl.rst | 7 ++
>> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 163 +++++++++++++++++++++++--
>> 2 files changed, 157 insertions(+), 13 deletions(-)
>>
>>
>> base-commit: 6a8f57ae2eb07ab39a6f0ccad60c760743051026
>

Subject: [tip: x86/cache] Documentation/x86: Documentation for MON group move feature

The following commit has been merged into the x86/cache branch of tip:

Commit-ID: e0a6ede2dd884adb73a7dde80444185b655f7c79
Gitweb: https://git.kernel.org/tip/e0a6ede2dd884adb73a7dde80444185b655f7c79
Author: Peter Newman <[email protected]>
AuthorDate: Wed, 19 Apr 2023 14:50:15 +02:00
Committer: Borislav Petkov (AMD) <[email protected]>
CommitterDate: Wed, 07 Jun 2023 12:42:12 +02:00

Documentation/x86: Documentation for MON group move feature

Describe new support for moving MON groups to a new parent CTRL_MON
group and its restrictions.

Signed-off-by: Peter Newman <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Reviewed-by: Reinette Chatre <[email protected]>
Tested-by: Babu Moger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
Documentation/arch/x86/resctrl.rst | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst
index 387ccbc..cb05d90 100644
--- a/Documentation/arch/x86/resctrl.rst
+++ b/Documentation/arch/x86/resctrl.rst
@@ -287,6 +287,13 @@ Removing a directory will move all tasks and cpus owned by the group it
represents to the parent. Removing one of the created CTRL_MON groups
will automatically remove all MON groups below it.

+Moving MON group directories to a new parent CTRL_MON group is supported
+for the purpose of changing the resource allocations of a MON group
+without impacting its monitoring data or assigned tasks. This operation
+is not allowed for MON groups which monitor CPUs. No other move
+operation is currently allowed other than simply renaming a CTRL_MON or
+MON group.
+
All groups contain the following files:

"tasks":