-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: main
Are you sure you want to change the base?
Conversation
7c629c8
to
62ccdb1
Compare
there's too much external dependencies for a couple of |
sorry, didn't mean to close this one |
A commit message with some details about what is being done, links to docs etc might be helpful, too. |
b6266be
to
2b63c34
Compare
This ^^^ is still valid. |
2b63c34
to
3e3bcae
Compare
CI build failed with following error "FAIL - commit subject exceeds 90 characters". |
3e3bcae
to
711c104
Compare
711c104
to
507ecec
Compare
397e410
to
2852ea3
Compare
Is it possible to review and merge this PR? |
@Creatone hey, can you refresh this one? I see that |
@kolyshkin sure, just give me a couple of days :) |
55151f9
to
7d19bd3
Compare
@kolyshkin PTAL |
There was a problem hiding this 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?
libcontainer/intelrdt/monitoring.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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.
6e254b4
to
e5ce002
Compare
@kolyshkin I force-pushed my changes, are you ok with that? PTAL :) |
More info: https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt Signed-off-by: Paweł Szulik <pawel.szulik@intel.com>
e5ce002
to
775a366
Compare
Signed-off-by: Paweł Szulik <paul.szulik@gmail.com>
@@ -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) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
if l3CacheSchema != "" || memBwSchema != "" { | ||
// Schema can be set only in Control Group. | ||
if m.monitoringGroup { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two if
s 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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: errors.New
.
if config.IntelRdt.L3CacheSchema != "" || config.IntelRdt.MemBwSchema != "" || config.IntelRdt.ClosID != "" { | ||
monitoringGroup = false | ||
} else if config.IntelRdt.EnableCMT || config.IntelRdt.EnableMBM { | ||
monitoringGroup = true |
There was a problem hiding this comment.
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.
path := m.GetPath() | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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? |
@Rouzip I'll try to address @kolyshkin comments this week. |
There was a problem hiding this comment.
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?
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 pawel.szulik@intel.com