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

[cgroups2] Introduces the MemoryControllerProcess. #577

Closed
wants to merge 2 commits into from

Conversation

DevinLeamy
Copy link
Contributor

Introduces the MemoryControllerProcess, the cgroups v2 memory
isolator, which will be used by the Cgroups2IsolatorProcess.

Unlike the MemorySubsystemProcess, the cgroups v1 memory isolator, we:

  • Don't allow limits on swap memory to be set.
  • Don't report memory pressure levels (this facility is no longer part
    of the cgroups memory controller's API)

Future work may include:

  • Adding support for swap memory, and
  • Reporting the (now available) memory pressure stall information

This patch updates the ROOT_MemUsage so it passes on a cgroups v2 machine using the new MemoryControllerProcess.

@DevinLeamy DevinLeamy marked this pull request as ready for review April 25, 2024 20:09
@DevinLeamy DevinLeamy force-pushed the mem-controller branch 3 times, most recently from ef27991 to 4573f73 Compare April 26, 2024 15:16
Introduces the `MemoryControllerProcess`, the cgroups v2 memory
isolator, which will be used by the `Cgroups2IsolatorProcess`.

Unlike the `MemorySubsystemProcess`, the cgroups v1 memory isolator, we:
- Don't allow limits on swap memory to be set.
- Don't report memory pressure levels (this facility is no longer part
  of the cgroups memory controller's API)

Future work may include:
- Adding support for swap memory, and
- Reporting the (now available) memory pressure stall information
Bytes softLimit = std::max(memory, MIN_MEMORY);

// Set the soft memory limit.
Try<Nothing> high = cgroups2::memory::set_high(cgroup, softLimit);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be set_low instead for the same behavior as soft limit in v1

@bmahler
Copy link
Contributor

bmahler commented May 9, 2024

Going to land this via #581 instead since it needed a minor fix.

@bmahler bmahler closed this May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants