Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
failcnt = IntegerFile("memory.failcnt")
memsw_failcnt = IntegerFile("memory.memsw.failcnt")
limit_in_bytes = IntegerFile("memory.limit_in_bytes")
soft_limit_in_bytes = IntegerFile("memory.soft_limit_in_bytes")
usage_in_bytes = IntegerFile("memory.usage_in_bytes")
max_usage_in_bytes = IntegerFile("memory.max_usage_in_bytes")
memsw_limit_in_bytes = IntegerFile("memory.memsw.limit_in_bytes")
memsw_usage_in_bytes = IntegerFile("memory.memsw.usage_in_bytes")
memsw_max_usage_in_bytes = IntegerFile("memory.memsw.max_usage_in_bytes")
swappiness = IntegerFile("memory.swappiness")
stat = DictFile("memory.stat", readonly=True)
use_hierarchy = FlagFile("memory.use_hierarchy")
force_empty = FlagFile("memory.force_empty")
oom_control = FlagFile("memory.oom_control")
move_charge_at_immigrate = BitFieldFile("memory.move_charge_at_immigrate")
# Requires special file interface
# numa_stat =
# Requires eventfd handling - https://www.kernel.org/doc/Documentation/cgroups/memory.txt
# pressure_level =
class DevicesController(Controller):
"""
"""
Cpu cGroup controller. Provides access to
cpu.cfs_period_us
cpu.cfs_quota_us
cpu.rt_period_us
cpu.rt_runtime_us
cpu.shares
cpu.stat
"""
cfs_period_us = IntegerFile("cpu.cfs_period_us")
cfs_quota_us = IntegerFile("cpu.cfs_quota_us")
rt_period_us = IntegerFile("cpu.rt_period_us")
rt_runtime_us = IntegerFile("cpu.rt_runtime_us")
shares = IntegerFile("cpu.shares")
stat = DictFile("cpu.stat", readonly=True)
class CpuAcctController(Controller):
"""
cpuacct.stat
cpuacct.usage
cpuacct.usage_percpu
"""
acct_stat = DictFile("cpuacct.stat", readonly=True)
usage = IntegerFile("cpuacct.usage")
usage_percpu = IntegerListFile("cpuacct.usage_percpu", readonly=True)
class CpuSetController(Controller):
class NetClsController(Controller):
"""
net_cls.classid
"""
class_id = IntegerFile("net_cls.classid")
class NetPrioController(Controller):
"""
net_prio.prioidx
net_prio.ifpriomap
"""
prioidx = IntegerFile("net_prio.prioidx", readonly=True)
ifpriomap = DictFile("netprio.ifpriomap")
cfs_period_us = IntegerFile("cpu.cfs_period_us")
cfs_quota_us = IntegerFile("cpu.cfs_quota_us")
rt_period_us = IntegerFile("cpu.rt_period_us")
rt_runtime_us = IntegerFile("cpu.rt_runtime_us")
shares = IntegerFile("cpu.shares")
stat = DictFile("cpu.stat", readonly=True)
class CpuAcctController(Controller):
"""
cpuacct.stat
cpuacct.usage
cpuacct.usage_percpu
"""
acct_stat = DictFile("cpuacct.stat", readonly=True)
usage = IntegerFile("cpuacct.usage")
usage_percpu = IntegerListFile("cpuacct.usage_percpu", readonly=True)
class CpuSetController(Controller):
"""
CpuSet cGroup controller. Provides access to
cpuset.cpu_exclusive
cpuset.cpus
cpuset.mem_exclusive
cpuset.mem_hardwall
cpuset.memory_migrate
cpuset.memory_pressure
cpuset.memory_pressure_enabled