博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
慢慢欣赏linux cgroup
阅读量:4070 次
发布时间:2019-05-25

本文共 5830 字,大约阅读时间需要 19 分钟。

创建cpu的cgroup的过程

root@cliffr zl]# cat /proc/cpuinfo processor       : 0vendor_id       : GenuineIntelcpu family      : 6model           : 55model name      : Intel(R) Atom(TM) CPU  Z3735F @ 1.33GHzstepping        : 8cpu MHz         : 1332.696cache size      : 1024 KBphysical id     : 0siblings        : 4core id         : 0cpu cores       : 4apicid          : 0initial apicid  : 0fdiv_bug        : nohlt_bug         : nof00f_bug        : nocoma_bug        : nofpu             : yesfpu_exception   : yescpuid level     : 11wp              : yesflags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx rdtscp constant_tsc xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes rdrand lahf_lm 3dnowprefetchbogomips        : 2665.39clflush size    : 64cache_alignment : 64address sizes   : 36 bits physical, 48 bits virtualpower management:processor       : 1vendor_id       : GenuineIntelcpu family      : 6model           : 55model name      : Intel(R) Atom(TM) CPU  Z3735F @ 1.33GHzstepping        : 8cpu MHz         : 1332.696cache size      : 1024 KBphysical id     : 0siblings        : 4core id         : 1cpu cores       : 4apicid          : 1initial apicid  : 1fdiv_bug        : nohlt_bug         : nof00f_bug        : nocoma_bug        : nofpu             : yesfpu_exception   : yescpuid level     : 11wp              : yesflags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx rdtscp constant_tsc xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes rdrand lahf_lm 3dnowprefetchbogomips        : 2665.39clflush size    : 64cache_alignment : 64address sizes   : 36 bits physical, 48 bits virtualpower management:processor       : 2vendor_id       : GenuineIntelcpu family      : 6model           : 55model name      : Intel(R) Atom(TM) CPU  Z3735F @ 1.33GHzstepping        : 8cpu MHz         : 1332.696cache size      : 1024 KBphysical id     : 0siblings        : 4core id         : 2cpu cores       : 4apicid          : 2initial apicid  : 2fdiv_bug        : nohlt_bug         : nof00f_bug        : nocoma_bug        : nofpu             : yesfpu_exception   : yescpuid level     : 11wp              : yesflags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx rdtscp constant_tsc xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes rdrand lahf_lm 3dnowprefetchbogomips        : 2665.39clflush size    : 64cache_alignment : 64address sizes   : 36 bits physical, 48 bits virtualpower management:processor       : 3vendor_id       : GenuineIntelcpu family      : 6model           : 55model name      : Intel(R) Atom(TM) CPU  Z3735F @ 1.33GHzstepping        : 8cpu MHz         : 1332.696cache size      : 1024 KBphysical id     : 0siblings        : 4core id         : 3cpu cores       : 4apicid          : 3initial apicid  : 3fdiv_bug        : nohlt_bug         : nof00f_bug        : nocoma_bug        : nofpu             : yesfpu_exception   : yescpuid level     : 11wp              : yesflags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx rdtscp constant_tsc xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 movbe popcnt aes rdrand lahf_lm 3dnowprefetchbogomips        : 2665.39clflush size    : 64cache_alignment : 64address sizes   : 36 bits physical, 48 bits virtualpower management:[root@cliffr zl]# [root@cliffr zl]# mkdir /dev/cgroup_cpu[root@cliffr zl]# mount -t cgroup -o cpuset cpuset /dev/cgroup_cpu/[root@cliffr zl]# ls /dev/cgroup_cpu/cgroup.event_control  cpuset.cpus           cpuset.memory_migrate           cpuset.memory_spread_page  cpuset.sched_load_balance        notify_on_releasecgroup.procs          cpuset.mem_exclusive  cpuset.memory_pressure          cpuset.memory_spread_slab  cpuset.sched_relax_domain_level  release_agentcpuset.cpu_exclusive  cpuset.mem_hardwall   cpuset.memory_pressure_enabled  cpuset.mems                libvirt                          tasks[root@cliffr zl]# cd /dev/cgroup_cpu/[root@cliffr cgroup_cpu]# mkdir Charlie[root@cliffr cgroup_cpu]# cd Charlie[root@cliffr Charlie]# lscgroup.event_control  cpuset.cpus           cpuset.memory_migrate      cpuset.memory_spread_slab  cpuset.sched_relax_domain_levelcgroup.procs          cpuset.mem_exclusive  cpuset.memory_pressure     cpuset.mems                notify_on_releasecpuset.cpu_exclusive  cpuset.mem_hardwall   cpuset.memory_spread_page  cpuset.sched_load_balance  tasks[root@cliffr Charlie]# /bin/echo 2-3 > cpuset.cpus[root@cliffr Charlie]# cat cpuset.cpus 2-3[root@cliffr Charlie]# cat cpuset.mems [root@cliffr Charlie]# echo 1 > cpuset.memsbash: echo: write error: Numerical result out of range[root@cliffr Charlie]# echo 0 > cpuset.mems[root@cliffr Charlie]# cat cpuset.mems 0[root@cliffr Charlie]# echo $$ > tasks[root@cliffr Charlie]# cat tasks 23832407[root@cliffr Charlie]# ps  PID TTY          TIME CMD 2376 pts/0    00:00:00 su 2383 pts/0    00:00:00 bash 2408 pts/0    00:00:00 ps[root@cliffr Charlie]#

 

Linux Cgroup浅析

https://zhuanlan.zhihu.com/p/102372680

Linux cgroup机制分析之框架分析

https://blog.csdn.net/ctoday/article/details/20838587

Linux cgroup机制分析之框架分析

http://blog.chinaunix.net/uid-20543183-id-1930840.html

Cgroup框架分析

https://blog.csdn.net/zhangyifei216/article/details/49491549

Android/Linux下CGroup框架分析及其使用

https://www.cnblogs.com/arnoldlu/p/6208443.html

cgroup框架结构

http://blog.chinaunix.net/uid-30126070-id-5065454.html

Docker背后的内核知识——cgroups资源限制

http://www.sel.zju.edu.cn/?p=573

cgroup中的cgroup_subsys[]数组解析

https://blog.csdn.net/wennuanddianbo/article/details/71244276

Linux Cgroups详解  好文

https://www.cnblogs.com/lisperl/archive/2012/04/17/2453838.html

你可能感兴趣的文章
139. Word Break (DP)
查看>>
23. Merge k Sorted Lists (Divide and conquer, Linked List) 以及java匿名内部类
查看>>
Tensorflow入门资料
查看>>
剑指_用两个栈实现队列
查看>>
剑指_顺时针打印矩阵
查看>>
剑指_栈的压入弹出序列
查看>>
剑指_复杂链表的复制
查看>>
服务器普通用户(非管理员账户)在自己目录下安装TensorFlow
查看>>
星环后台研发实习面经
查看>>
大数相乘不能用自带大数类型
查看>>
字节跳动后端开发一面
查看>>
CentOS Tensorflow 基础环境配置
查看>>
centOS7安装FTP
查看>>
FTP的命令
查看>>
CentOS操作系统下安装yum的方法
查看>>
ping 报name or service not known
查看>>
FTP 常见问题
查看>>
zookeeper单机集群安装
查看>>
do_generic_file_read()函数
查看>>
Python学习笔记之数据类型
查看>>