salamanderMH
V2EX  ›  问与答

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

  •  
  •   salamanderMH · Jul 4, 2019 · 1868 views
    This topic created in 2530 days ago, the information mentioned may be changed or developed.

    问题

    系统: 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
    
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   890 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:21 · PVG 06:21 · LAX 15:21 · JFK 18:21
    ♥ Do have faith in what you're doing.