cpuacct.txt

If you have any comment or update to the content, please contact the
original document maintainer directly. However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help. Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.


Chinese maintainer: 曾亮亮 <lianglaingzeng93@gmail.com>
---------------------------------------------------------------------
Documentation_powerpc_cpu_features.txt的中文翻译


如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。


中文版维护者:曾亮亮 <lianglaingzeng93@gmail.com>
中文版翻译者:曾亮亮 <lianglaingzeng93@gmail.com>
中文版校译者:曾亮亮 <lianglaingzeng93@gmail.com>


以下为正文

Linux/Documentation/cgroups/cpuacct.txt
   CPU Accounting Controller
   -------------------------
 
  The CPU accounting controller is used to group tasks using cgroups and
  account the CPU usage of these groups of tasks.
  cpu的计数控制器是用来组织组任务使用cgroups并统计这些组任务的cpu使用率。
 
  The CPU accounting controller supports multi-hierarchy groups. An accounting
  group accumulates the CPU usage of all of its child groups and the tasks
  directly present in its group.
  cpu的计数控制器支持多层次的组。一个计数组的所有子组都会逐渐提高cpu的使用率,并
  且会为这个组带来直接的影响。
  Accounting groups can be created by first mounting the cgroup filesystem.
  计数组可以由第一个上升的cgroup文件系统创建。
 # mount -t cgroup -ocpuacct none /sys/fs/cgroup
 1
  With the above step, the initial or the parent accounting group becomes
  visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in
  the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup.
  /sys/fs/cgroup/cpuacct.usage gives the CPU time (in nanoseconds) obtained
  by this group which is essentially the CPU time obtained by all the tasks
  in the system.
  按照上面的步骤,最初的或者说是双亲计数组将会在/sys/fs/cgroup目录下被访问。
  在启动时,这个组包括了这个系统中的所有任务。/sys/fs/cgroup/tasks目录下列
  出了所有在cgruop下的任务。/sys/fs/cgroup/cpuacct.usage给出了的cpu时间(以纳
  秒为单位)被这个组得到,本质上这个cpu时间是被整个系统中的所有任务得到。
 
  New accounting groups can be created under the parent group /sys/fs/cgroup.
  新的计数组可以在双亲组的目录/sys/fs/cgroup下被创立。
  # cd /sys/fs/cgroup
  # mkdir g1
  # echo $$ > g1/tasks
 
  The above steps create a new group g1 and move the current shell
  process (bash) into it. CPU time consumed by this bash and its children
  can be obtained from g1/cpuacct.usage and the same is accumulated in
  /sys/fs/cgroup/cpuacct.usage also.
  上面的步骤创立了一个新的组g1并且将当前的外部进程(bash)移动到这个组。由bash
  和他的子进程消耗的cpu时间可以从g1/cpuacct.usage中获得,在/sys/fs/cgroup/cpuacct.usage
  中累积的是一样的。
 
  cpuacct.stat file lists a few statistics which further divide the
  CPU time obtained by the cgroup into user and system times. Currently
  the following statistics are supported:
  cpuacct.start文件列出了一些统计数据,cpu时间被进一步划分为是从用户的
  cgroup中还是从系统中得到。目前下面的统计数据是支持查看的:
 
  user: Time spent by tasks of the cgroup in user mode.
  system: Time spent by tasks of the cgroup in kernel mode.
  用户:在用户模式的cgroup中的任务用掉的时间。
  系统:在内核模式的cgroup中的任务用掉的时间。
 
  user and system are in USER_HZ unit.
  用户和系统在USER_HZ单元。
 
  cpuacct controller uses percpu_counter interface to collect user and
  system times. This has two side effects:
  cpuacct控制器使用percpu_counter界面来收集用户和系统时间,这会带来两方面
  的影响:
  - It is theoretically possible to see wrong values for user and system times.
    This is because percpu_counter_read() on 32bit systems isn't safe
    against concurrent writes.
  - It is possible to see slightly outdated values for user and system times
    due to the batch processing nature of percpu_counter.
  -这在理论上可能会得到错误的关于用户和系统时间的值。这是因为percpu_counter_read()
   在32位系统中针对并行写入并不是安全的。
  - 这会导致得到已经有些过时的系统和用户时间的值因为percpu_counter的批处理特质。
   
   
   
   
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值