-
Notifications
You must be signed in to change notification settings - Fork 2.2k
runc update: support per-device weight and iops #4775
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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've seen the comment, the commit msg, etc. I might be tired, but I don't see why to do it in reverse order or not.
If it's duplicated, the first value must take precedence instead of the last value? Is this on the spec? Intuitively, it seems like an error to me (the config.json contradicts itself).
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.
To add a bit of context, this was added as a response to @lifubang suggestion at: #4775 (comment)
The spec doesn't tell anything about duplicated entries (meaning that they are implicitly allowed, and the precedence rules are not documented either).
The runc behavior is/was to apply all rules one-by-one, so if there is a duplicated rule, the latter one overwrites the former. This is the reason why we iterate backwards.
In practice, though, it doesn't matter much, because if there are no duplicated entries, the order doesn't matter, and my infinite belief in human decency tells me no one has duplicated entries anyway. Yet, if someone does, this trick here saves them from a disaster.
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.
You can also run the test case from the second commit without the fix from the same commit to see what's happening if we iterate as usual.
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.
Yes, sorry, I wanted to say I read that too. But today, a little bit less tired, I think I see it. We return after setting it, I didn't realize the for loop ended when we found the entry. Sorry!
It is not exactly the same behavior as before, if we were processing all the rules, though. Because if one property (let's say weight) wasn't set in the last entry of the config, it would have the value of the previous entry that set it.
I think this is edgy enough that we might be able to change it without anyone realizing. So let's try it :)
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 saw that one, too, but I think no one is actually using LeafWeight these days, so practically we only have one property.