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

[1.1] libct/cg: support hugetlb rsvd #4077

Merged
merged 2 commits into from
Oct 24, 2023

Commits on Oct 20, 2023

  1. [1.1] tests/int/helpers: add get_cgroup_path

    Separate it out of get_cgroup_value. Needed for the next commit.
    
    This function was initially introduced in main branch commit d4582ae.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    f8be700 View commit details
    Browse the repository at this point in the history
  2. libct/cg: support hugetlb rsvd

    This adds support for hugetlb.<pagesize>.rsvd limiting and accounting.
    
    The previous non-rsvd max/limit_in_bytes does not account for reserved
    huge page memory, making it possible for a processes to reserve all the
    huge page memory, without being able to allocate it (due to cgroup
    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 also keeps writing to the old max/limit_in_bytes, for backward
    compatibility.
    
    More info can be found here: https://lkml.org/lkml/2020/2/3/1153
    
    (commit message mostly written by Odin Ugedal)
    
    [1.1 backport: check for CGROUP_UNIFIED in integration test]
    
    Co-authored-by: Odin Ugedal <odin@ugedal.com>
    (cherry picked from commit 4a7d3ae)
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin and odinuge committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    8214e63 View commit details
    Browse the repository at this point in the history