This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 76e235c81 [cgroups2] Create memory controller using cgroups/all flag.
76e235c81 is described below

commit 76e235c815b097bc5260b368a11152b0f1c19fdf
Author: Jason Zhou <[email protected]>
AuthorDate: Mon Aug 12 16:51:20 2024 -0400

    [cgroups2] Create memory controller using cgroups/all flag.
    
    Currently, we cannot use the cgroups/all flag to its corresponding
    controllers in cgroups2.
    
    The flag causes us to grabs all the values in the cgroup.controllers
    file. But we should instead just add all the creators when we see
    cgroups/all, as many controllers are no longer present in
    cgroup.controllers in cgroups v2.
    
    This fix incidentally fixes the
    ROOT_CGROUPS_AgentRecoveryWithNewCgroupSubsystems test as it was unable
    to create the memory controller using cgroups/all flag.
    
    Review: https://reviews.apache.org/r/75162/
---
 .../containerizer/mesos/isolators/cgroups2/cgroups2.cpp      | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp 
b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
index 4174be0fa..fa164f3d6 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp
@@ -107,14 +107,12 @@ Try<Isolator*> Cgroups2IsolatorProcess::create(
   set<string> controllersToCreate = { "core" };
 
   if (strings::contains(flags.isolation, "cgroups/all")) {
-    Try<set<string>> available =
-      ::cgroups2::controllers::available(::cgroups2::path(flags.cgroups_root));
-    if (available.isError()) {
-      return Error("Failed to determine the available cgroups v2 controllers: "
-                   + available.error());
+    foreachkey (const string& creator, creators) {
+      controllersToCreate.insert(creator);
+    }
+    foreachkey (const string& creator, creatorsWithDeviceManager) {
+      controllersToCreate.insert(creator);
     }
-
-    controllersToCreate = *available;
   } else {
     foreach (string isolator, strings::tokenize(flags.isolation, ",")) {
       if (!strings::startsWith(isolator, "cgroups/")) {

Reply via email to