-
Notifications
You must be signed in to change notification settings - Fork 553
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
config-linux: add support for rsvd hugetlb cgroup #1116
Conversation
The previous non-rsvd max/limit_in_bytes does not account for reserved huge page memory, making it possible for a process to reserve all the huge page memory, without being able to allocate it (due to hugetlb cgroup page fault accounting restrictions). In practice this makes it possible to successfully mmap more huge page memory than allowed via the cgroup settings, but when using the memory the process will get a SIGBUS and crash. This is bad for applications trying to mmap at startup (and it succeeds), but the program crashes when starting to use the memory. eg. postgres is doing this by default. This patch updates and clarifies `LinuxResources.HugepageLimits` and `LinuxHugepageLimit` by defaulting the configurations go to rsvd hugetlb cgroup (when supported) and fallback to page fault accounting if not supported. Fixes opencontainers#1050 Signed-off-by: Kailun Qin <kailun.qin@intel.com>
@kailun-qin I'm confused, this patch only seems to include code comments and doc changes? |
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
This (together with runtime implementation) should fix the real issue with some software, described in #1050. |
@tianon 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.
LGTM
Thanks @kailun-qin! |
@kailun-qin @odinuge Do you have a PR for runc? |
Adds support for the rsvd hugetlb cgroup. Enables reservation time checks on huge paqe memory limits. More info: opencontainers/runtime-spec#1116
Adds support for the rsvd hugetlb cgroup. Enables reservation time checks on huge paqe memory limits. More info: opencontainers/runtime-spec#1116 Signed-off-by: Om Prakaash <omsuseela@gmail.com>
The previous non-rsvd max/limit_in_bytes does not account for reserved
huge page memory, making it possible for a process to reserve all the
huge page memory, without being able to allocate it (due to hugetlb
cgroup page fault accounting restrictions).
In practice this makes it possible to successfully mmap more huge page
memory than allowed via the cgroup settings, but when using the memory
the process will get a SIGBUS and crash. This is bad for applications
trying to mmap at startup (and it succeeds), but the program crashes
when starting to use the memory. eg. postgres is doing this by default.
This patch updates and clarifies
LinuxResources.HugepageLimits
andLinuxHugepageLimit
by defaulting the configurations go to rsvd hugetlbcgroup (when supported) and fallback to page fault accounting if not
supported.
Fixes #1050
Signed-off-by: Kailun Qin kailun.qin@intel.com