You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by "DevinLeamy (via GitHub)" <gi...@apache.org> on 2024/04/19 22:31:27 UTC

[PR] [cgroups2] Error if `--cgroups_limit_swap` is used when cgroups v2 is used. [mesos]

DevinLeamy opened a new pull request, #565:
URL: https://github.com/apache/mesos/pull/565

   Mesos does not support limiting swap memory when using cgroups v2. This is because the cgroups v2 API does not allow us to directly control the swap memory usage limit.  Rather, we can only control the combined swap _and_ RAM usage limit.
   
   Therefore, when the `--cgroups_limit_swap` flag is provided and cgroups v2 is used we error during flag validation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [cgroups2] Error if `--cgroups_limit_swap` is used when cgroups v2 is used. [mesos]

Posted by "DevinLeamy (via GitHub)" <gi...@apache.org>.
DevinLeamy commented on PR #565:
URL: https://github.com/apache/mesos/pull/565#issuecomment-2069528306

   > > This is because the cgroups v2 API does not allow us to directly control the swap memory usage limit. Rather, we can only control the combined swap and RAM usage limit.
   > 
   > This doesn't sound accurate? in v2 we are able to separately control swap usage
   
   It's the opposite - v1 combines RAM and swap and v2 gives direct control over both; you're right :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [cgroups2] Error if `--cgroups_limit_swap` is used when cgroups v2 is used. [mesos]

Posted by "bmahler (via GitHub)" <gi...@apache.org>.
bmahler closed pull request #565: [cgroups2] Error if `--cgroups_limit_swap` is used when cgroups v2 is used.
URL: https://github.com/apache/mesos/pull/565


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [cgroups2] Error if `--cgroups_limit_swap` is used when cgroups v2 is used. [mesos]

Posted by "bmahler (via GitHub)" <gi...@apache.org>.
bmahler commented on code in PR #565:
URL: https://github.com/apache/mesos/pull/565#discussion_r1573038742


##########
src/slave/flags.cpp:
##########
@@ -652,8 +657,25 @@ mesos::internal::slave::Flags::Flags()
   add(&Flags::cgroups_limit_swap,
       "cgroups_limit_swap",
       "Cgroups feature flag to enable memory limits on both memory and\n"
-      "swap instead of just memory.\n",
-      false);
+      "swap instead of just memory. Not supported if cgroups v2 is used.\n",
+      false,
+      [](const bool& limit_swap) -> Option<Error> {
+#ifdef ENABLE_CGROUPS_V2
+        Try<bool> mounted = cgroups2::mounted();
+        if (mounted.isError()) {
+            return Error("Failed to check if cgroup2 filesystem is mounted: "

Review Comment:
   nit: 2 space indent here and below



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [cgroups2] Error if `--cgroups_limit_swap` is used when cgroups v2 is used. [mesos]

Posted by "bmahler (via GitHub)" <gi...@apache.org>.
bmahler commented on PR #565:
URL: https://github.com/apache/mesos/pull/565#issuecomment-2067370799

   > This is because the cgroups v2 API does not allow us to directly control the swap memory usage limit. Rather, we can only control the combined swap and RAM usage limit.
   
   This doesn't sound accurate? in v2 we are able to separately control swap usage


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@mesos.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org