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

Added OOM notification for Memory controller #115

Merged
merged 4 commits into from
Nov 15, 2019

Conversation

Zyqsempai
Copy link
Contributor

Partially Fixes #104

@crosbymichael @AkihiroSuda
So this Pr is on of the ideas I have on how we can implement OOM notifications in cGroupv2.
So, I see here at least two directions, we can implement Inotify fd check right here and in case if we receive inotify event, create new separate file for oom's only, and return that file fd.
On other hand we can delegate it to next layers(containerd etc.)
What do you think of this approach?
Signed-off-by: bpopovschi zyqsempai@mail.ru

v2/manager.go Outdated Show resolved Hide resolved
@AkihiroSuda
Copy link
Member

in case if we receive inotify event, create new separate file for oom's only, and return that file fd.

Does kernel have this feature? Seems not https://facebookmicrosites.github.io/cgroup2/docs/memory-controller.html

v2/manager.go Outdated Show resolved Hide resolved
@Zyqsempai
Copy link
Contributor Author

@AkihiroSuda Do we actually care about other events here? Coz we can easily filter it only by oom

@AkihiroSuda
Copy link
Member

Yes, but I agree it is not now

@codecov-io
Copy link

codecov-io commented Nov 12, 2019

Codecov Report

Merging #115 into master will decrease coverage by 0.59%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #115     +/-   ##
=========================================
- Coverage   36.34%   35.75%   -0.6%     
=========================================
  Files          32       32             
  Lines        2102     2137     +35     
=========================================
  Hits          764      764             
- Misses       1210     1245     +35     
  Partials      128      128
Impacted Files Coverage Δ
v2/manager.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d26e1b3...d03d516. Read the comment docs.

@Zyqsempai
Copy link
Contributor Author

@AkihiroSuda You mean something like this? PTAL

v2/manager.go Outdated Show resolved Hide resolved
v2/manager.go Outdated Show resolved Hide resolved
v2/manager.go Outdated Show resolved Hide resolved
v2/manager.go Outdated Show resolved Hide resolved
v2/manager.go Outdated Show resolved Hide resolved
@Zyqsempai
Copy link
Contributor Author

@crosbymichael PTAL

@crosbymichael
Copy link
Member

rebase please :)

Signed-off-by: bpopovschi <zyqsempai@mail.ru>
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
@Zyqsempai
Copy link
Contributor Author

@crosbymichael Done.

@crosbymichael
Copy link
Member

LGTM

@crosbymichael crosbymichael merged commit c4474e8 into containerd:master Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cgroup2: check list for v2 controller implementations
4 participants