cgroup 限制内存写入文件 memory.limit_in_bytes I/O error?

2019-07-04 13:17:56 +08:00
 salamanderMH

问题

系统: Ubuntu 18.04.2 LTS 内核版本: 4.15.0-50-generic 在**/sys/fs/cgroup/memory建了一个目录 my-test,然后想设置内存限额,写文件sh -c "echo 1M > memory.limit_in_bytes"**,发生错误

sh: echo: I/O error

my-test 目录列表

ls -al
总用量 0
drwxr-xr-x 2 root root 0 7 月   4 12:31 .
dr-xr-xr-x 6 root root 0 7 月   4 12:31 ..
-rw-r--r-- 1 root root 0 7 月   4 12:31 cgroup.clone_children
--w--w--w- 1 root root 0 7 月   4 12:31 cgroup.event_control
-rw-r--r-- 1 root root 0 7 月   4 12:31 cgroup.procs
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.failcnt
--w------- 1 root root 0 7 月   4 12:31 memory.force_empty
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.failcnt
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.limit_in_bytes
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.max_usage_in_bytes
-r--r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.slabinfo
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.tcp.failcnt
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.tcp.limit_in_bytes
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.tcp.max_usage_in_bytes
-r--r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.tcp.usage_in_bytes
-r--r--r-- 1 root root 0 7 月   4 12:31 memory.kmem.usage_in_bytes
-rw-r--r-- 1 root root 0 7 月   4 12:38 memory.limit_in_bytes
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.max_usage_in_bytes
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.move_charge_at_immigrate
-r--r--r-- 1 root root 0 7 月   4 12:31 memory.numa_stat
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.oom_control
---------- 1 root root 0 7 月   4 12:31 memory.pressure_level
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.soft_limit_in_bytes
-r--r--r-- 1 root root 0 7 月   4 12:31 memory.stat
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.swappiness
-r--r--r-- 1 root root 0 7 月   4 12:31 memory.usage_in_bytes
-rw-r--r-- 1 root root 0 7 月   4 12:31 memory.use_hierarchy
-rw-r--r-- 1 root root 0 7 月   4 12:31 notify_on_release
-rw-r--r-- 1 root root 0 7 月   4 12:31 tasks

1536 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/579960

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX