-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74985/
-----------------------------------------------------------

Review request for mesos and Benjamin Mahler.


Repository: mesos


Description
-------

Introduces `::usage` to the MemoryControllerProcess to report the total
memory usage of a cgroup as well as memory usage statistics provided
by `cgroups2::memory:stats`.

Patch also fixes the failures on mesos::internal::tests::MemoryIsolatorTest 
when running on a CentOS 9 system with cGroupsV2 configured.

For the mesos::internal::slave::MemorySubsystemProcess::usage function, the 
mapping reflects the stats reported in the v1 usage function, with the 
exception of swap memory as we disable the cgroups_limit_swap flag in v2

Attributes used in in usage reporting:

set_mem_total_bytes: memory.usage_in_bytes in v1, memory.current in v2 - 
current usage for memory
set_mem_kmem_usage_bytes: memory.kmem.usage_in_bytes in v1, memory.stat.kernel 
in v2 - Amount of total kernel memory
set_mem_kmem_tcp_usage_bytes: memory.kmem.tcp.usage_in_bytes in v1, 
memory.stat.sock in v2 - Amount of memory used in network transmission buffers
set_mem_file_bytes: memory.stat.total_cache in v1, memory.stat.file in v2 - 
Amount of memory used to cache filesystem data
set_mem_cache_bytes: memory.stat.total_cache in v1, memory.stat.file in v2 - 
Amount of memory used to cache filesystem data
set_mem_anon_bytes: memory.stat.total_rss in v1, memory.stat.anon in v2 - 
Amount of memory used in anonymous mappings
set_mem_rss_bytes: memory.stat.total_rss in v1, memory.stat.anon in v2 - Amount 
of memory used in anonymous mappings
set_mem_mapped_file_bytes: memory.stat.total_mapped_file in v1, 
memory.stat.file_mapped in v2 - Amount of cached filesystem data
set_mem_unevictable_bytes: memory.stat.total_unevictable in v1, memory.min in 
v2 - Hard memory protection. If the memory usage of a cgroup is within its 
effective min boundary, the cgroup’s memory won’t be reclaimed under any 
conditions

Docs referenced: 
https://docs.kernel.org/admin-guide/cgroup-v1/memory.html#benefits-and-purpose-of-the-memory-controller
https://docs.kernel.org/admin-guide/cgroup-v2.html#memory
https://stackoverflow.com/questions/74796436/rss-memory-equivalent-in-cgroup-v2


Diffs
-----

  src/slave/containerizer/mesos/isolators/cgroups2/controllers/memory.hpp 
2e60b2c19a781c2d8ab24e89e440383ca517868c 
  src/slave/containerizer/mesos/isolators/cgroups2/controllers/memory.cpp 
732b1c65febdc78d8854e571bb02a9d367528434 
  src/tests/containerizer/memory_isolator_tests.cpp 
ec0f359a253ebaf8d7937876ba6f265d93d45ddd 
  src/tests/mesos.cpp 762200cda73e3e1cda0755c44f4fffc974f0927b 


Diff: https://reviews.apache.org/r/74985/diff/1/


Testing
-------


Thanks,

Jason Zhou

Reply via email to