Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mon groups for resctrl. #2523

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Creatone
Copy link
Contributor

@Creatone Creatone commented Jul 21, 2020

On a system with RDT control features additional directories can be
created in the root directory that specify different amounts of each
resource. The root and these additional top level
directories are referred to as "CTRL_MON" groups.
And this is already implemented in runc.

On a system with RDT monitoring the root directory and other top level
directories contain a directory named "mon_groups" in which additional
directories can be created to monitor subsets of tasks in the CTRL_MON
group that is their ancestor.
And that PR implements this behavior.

More info:
https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt

#2519

Signed-off-by: Paweł Szulik [email protected]

@Creatone Creatone force-pushed the resctrl-mon-group branch 3 times, most recently from 7c629c8 to 62ccdb1 Compare July 22, 2020 12:19
@kolyshkin
Copy link
Contributor

there's too much external dependencies for a couple of assert.EqualError calls in a test case. Can you please redo it without using stretchr/testify? I am not against using it in general, but for a small case like this it seems excessive.

@kolyshkin kolyshkin closed this Jul 22, 2020
@kolyshkin
Copy link
Contributor

sorry, didn't mean to close this one

@kolyshkin kolyshkin reopened this Jul 22, 2020
@kolyshkin
Copy link
Contributor

A commit message with some details about what is being done, links to docs etc might be helpful, too.

@Creatone Creatone force-pushed the resctrl-mon-group branch 3 times, most recently from b6266be to 2b63c34 Compare July 27, 2020 13:07
@Creatone
Copy link
Contributor Author

@kolyshkin

@kolyshkin
Copy link
Contributor

A commit message with some details about what is being done, links to docs etc might be helpful, too.

This ^^^ is still valid.

@katarzyna-z
Copy link

CI build failed with following error "FAIL - commit subject exceeds 90 characters".
@Creatone Could you fix this?

@Creatone
Copy link
Contributor Author

Creatone commented Aug 3, 2020

@kolyshkin @katarzyna-z

@Creatone
Copy link
Contributor Author

@Creatone Creatone force-pushed the resctrl-mon-group branch 3 times, most recently from 397e410 to 2852ea3 Compare August 25, 2020 12:29
@Creatone
Copy link
Contributor Author

Creatone commented Sep 1, 2020

Is it possible to review and merge this PR?
I want to fix bugs with Resctrl metrics in the cAdvisor project and I just need this one.

AkihiroSuda
AkihiroSuda previously approved these changes Sep 10, 2020
@kolyshkin
Copy link
Contributor

@Creatone hey, can you refresh this one? I see that EnableCMT and EnableMBM appeared in runtime-spec, so we can use those now
.

@Creatone
Copy link
Contributor Author

Creatone commented May 6, 2022

@kolyshkin sure, just give me a couple of days :)

@Creatone Creatone force-pushed the resctrl-mon-group branch 2 times, most recently from 55151f9 to 7d19bd3 Compare May 18, 2022 14:27
@Creatone
Copy link
Contributor Author

@kolyshkin PTAL

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some old review comments that I forgot to submit.

Also, this needs rebasing. Can you take a look @Creatone?

go.mod Outdated Show resolved Hide resolved
libcontainer/configs/intelrdt.go Show resolved Hide resolved
@@ -59,14 +59,14 @@ func getMonitoringStats(containerPath string, stats *Stats) error {
for _, file := range numaFiles {
if file.IsDir() {
numaPath := filepath.Join(containerPath, "mon_data", file.Name())
if IsMBMEnabled() {
if IsMBMEnabled() && enableMBM {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: perhaps reverse the order of checks, since checking a boolean is faster than calling a function.

libcontainer/intelrdt/monitoring.go Outdated Show resolved Hide resolved
libcontainer/specconv/spec_linux.go Outdated Show resolved Hide resolved
@Creatone Creatone force-pushed the resctrl-mon-group branch 5 times, most recently from 6e254b4 to e5ce002 Compare December 1, 2022 20:52
@Creatone
Copy link
Contributor Author

Creatone commented Dec 1, 2022

@kolyshkin I force-pushed my changes, are you ok with that? PTAL :)

Signed-off-by: Paweł Szulik <[email protected]>
@@ -579,8 +641,8 @@ func (m *Manager) GetStats() (*Stats, error) {
}
}

if IsMBMEnabled() || IsCMTEnabled() {
err = getMonitoringStats(containerPath, stats)
if (IsCMTEnabled() && m.config.IntelRdt.EnableCMT) || (IsMBMEnabled() && m.config.IntelRdt.EnableMBM) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be if m.monitoringGroup?

l3CacheSchema := container.IntelRdt.L3CacheSchema
memBwSchema := container.IntelRdt.MemBwSchema

// Write a single joint schema string to schemata file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is either misplaced or misleading.

Comment on lines +707 to +709
if l3CacheSchema != "" || memBwSchema != "" {
// Schema can be set only in Control Group.
if m.monitoringGroup {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two ifs can be combined into one.

if l3CacheSchema != "" || memBwSchema != "" {
// Schema can be set only in Control Group.
if m.monitoringGroup {
return fmt.Errorf("couldn't set IntelRdt l3CacheSchema or memBwSchema for the monitoring group")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: errors.New.

Comment on lines +213 to +216
if config.IntelRdt.L3CacheSchema != "" || config.IntelRdt.MemBwSchema != "" || config.IntelRdt.ClosID != "" {
monitoringGroup = false
} else if config.IntelRdt.EnableCMT || config.IntelRdt.EnableMBM {
monitoringGroup = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Creatone am reading this right, that if ClosID or L3CacheSchema or MemBwSchema is set, the settings for EnableCMT and EnableMBM are silently ignored?

If yes, such configuration should probably be rejected during validation.

Comment on lines -640 to +702
path := m.GetPath()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add an empty line here.

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few more comments. Also, please squash the commits.

@AkihiroSuda AkihiroSuda mentioned this pull request Nov 6, 2023
21 tasks
@Rouzip
Copy link

Rouzip commented Nov 8, 2023

Hi, @Creatone . Thanks for your efforts on this pr. I noticed that you have not updated this pr anymore recently. Do you mind if I help you continue working on this pr?

@Creatone
Copy link
Contributor Author

Creatone commented Nov 9, 2023

@Rouzip I'll try to address @kolyshkin comments this week.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add rmid field for special monitor group name in the future?

@cyphar cyphar modified the milestones: 1.2.0, 1.3.0 Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants