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/10 18:48:33 UTC
[PR] [cgroups2] Introduce `memory` controller. [mesos]
DevinLeamy opened a new pull request, #553:
URL: https://github.com/apache/mesos/pull/553
Introduces the cgroups v2 `memory` controller, the `cgroups2::memory::usage` function, to obtain the memory usage of a cgroup and its descendants' , and a test.
--
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] Introduce `memory` controller. [mesos]
Posted by "bmahler (via GitHub)" <gi...@apache.org>.
bmahler closed pull request #553: [cgroups2] Introduce `memory` controller.
URL: https://github.com/apache/mesos/pull/553
--
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] Introduce `memory` controller. [mesos]
Posted by "bmahler (via GitHub)" <gi...@apache.org>.
bmahler commented on code in PR #553:
URL: https://github.com/apache/mesos/pull/553#discussion_r1561754342
##########
src/linux/cgroups2.cpp:
##########
@@ -767,6 +767,27 @@ Try<cpu::BandwidthLimit> max(const string& cgroup)
} // namespace cpu {
+namespace memory {
+
+namespace control {
+
+const string CURRENT = "memory.current";
+
+} // namespace control {
+
+Try<Bytes> usage(const string& cgroup)
+{
+ Try<string> contents = cgroups2::read<string>(
+ cgroup, memory::control::CURRENT);
+ if (contents.isError()) {
+ return Error("Failed to read 'memory.current': " + contents.error());
+ }
+
+ return Bytes::parse(strings::trim(*contents) + "B");
Review Comment:
we can just read<uint64_t> here and avoid the need for trimming / parsing below, by directly constructing Bytes(uint64_t)
--
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