V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
salamanderMH
V2EX  ›  问与答

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

  •  
  •   salamanderMH · 2019-07-04 13:17:56 +08:00 · 1535 次点击
    这是一个创建于 1758 天前的主题,其中的信息可能已经有所发展或是发生改变。

    问题

    系统: 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
    
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   947 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:46 · PVG 04:46 · LAX 13:46 · JFK 16:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.