-
Notifications
You must be signed in to change notification settings - Fork 62
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 support for adjusting OOM score adjustment. #94
Conversation
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.
Thank's for the PR @zxj874478410 ! I have a few nits, but otherwise it looks good to me.
Thanks for the review @klihub . I've fixed these faults. |
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.
lgtm
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.
wondering if we should be able to nil out the oooscoreadj
94de1db
to
f3f0bd7
Compare
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.
LGTM
1712c1a
to
83f6ab0
Compare
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.
LGTM
Signed-off-by: Xiaojin Zhang <[email protected]>
|
@zxj874478410 This fix is not sufficient in it's current form as it breaks replacing a mount with another one to the same destination. I think we'd need a bit of additional code to prevent that from happening. Maybe something like this, where 8f509e7 is an updated version of your commit, and 7ea0a47 adds a new test case for mount removal. |
@zxj874478410 PTAL at the latest review comments and the suggested fixes/improvements.
Thanks for the detailed instructions, but does this problem refer to another pr #87 ? This one refers to OOM score adjustment. |
Argh... Sorry about that. Yes, you are absolutely right, it is about PR #87. Time to renew my glasses or get a brain transplant... |
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.
LGTM
The OomScoreAdj field is added to the LinuxContainerAdjustment structure of the NRI plugin. This field records the value of oom_score_adj that needs to be adjusted during CreateContainer. Added the appropriate set method and the method to write back to the NRI response.
Fix #92
TEST METHOD:
We build a NRI plugin with CreateContainer function like this:
Then run this NRI plugin with containerd. Create a k8s pod of apache.
Run the docker inspect command to query the process ID of the Apache container is 3445531.
At last, query the oom_score_adj of this pid. It has been set to 121 successfully.