cf-natali commented on code in PR #462:
URL: https://github.com/apache/mesos/pull/462#discussion_r1453898009


##########
src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp:
##########
@@ -460,6 +460,26 @@ Future<ResourceStatistics> MemorySubsystemProcess::usage(
 
   result.set_mem_total_bytes(usage->bytes());
 
+  Result<Bytes> kmem_usage = cgroups::memory::kmem_usage_in_bytes(
+      hierarchy, cgroup);
+
+  if (kmem_usage.isError()) {
+    return Failure("Failed to parse 'memory.kmem.usage_in_bytes': " +
+                   kmem_usage.error());
+  } else if (kmem_usage.isSome()) {
+    result.set_mem_kmem_usage_bytes(kmem_usage.get().bytes());
+  }
+
+  Result<Bytes> kmem_tcp_usage = cgroups::memory::kmem_tcp_usage_in_bytes(
+      hierarchy, cgroup);
+
+  if (kmem_tcp_usage.isError()) {
+    return Failure("Failed to parse 'memory.kmem.tcp.usage_in_bytes': " +
+                   kmem_tcp_usage.error());
+  } else if (kmem_usage.isSome()) {

Review Comment:
   Should be `kmem_tcp_usage` here.



##########
include/mesos/v1/mesos.proto:
##########
@@ -1783,6 +1783,12 @@ message ResourceStatistics {
   // Total memory + swap usage. This is set if swap is enabled.
   optional uint64 mem_total_memsw_bytes = 37;
 
+  // Current kernel memory allocation
+  optional uint64 mem_kmem_usage_bytes = 52;

Review Comment:
   Is there a reason the valued don't match `include/mesos/mesos.proto`?



##########
include/mesos/mesos.proto:
##########
@@ -1819,6 +1819,12 @@ message ResourceStatistics {
   // Total memory + swap usage. This is set if swap is enabled.
   optional uint64 mem_total_memsw_bytes = 37;
 
+  // Current kernel memory allocation

Review Comment:
   Nit: other comments end with a dot '.'.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to