您的位置:首页 > 其它

Documentation_scheduler_sched-stats

2013-10-16 10:23 204 查看
Chinese translated version of Documentation_scheduler_sched-stats

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:Hu Feijun <935620544@qq.com>

---------------------------------------------------------------------

Documentation_scheduler_sched-stats的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文

交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻

译存在问题,请联系中文版维护者。

中文版维护者: 胡飞军 Hu Feijun <935620544@qq.com>

中文版翻译者: 胡飞军 Hu Feijun <935620544@qq.com>

中文版校译者: 胡飞军 Hu Feijun <935620544@qq.com>

以下为正文

---------------------------------------------------------------------

Version 15 of schedstats dropped counters for some sched_yield:

yld_exp_empty, yld_act_empty and yld_both_empty. Otherwise, it is

identical to version 14.

版本15的schedstats中的sched_yield函数去掉了一些计数器:yld_exp_empty,

yld_act_empty 和 yld_both_empty,否则的话就和版本14的schedstats没有什么

差别了。

Version 14 of schedstats includes support for sched_domains, which hit the

mainline kernel in 2.6.20 although it is identical to the stats from version

12 which was in the kernel from 2.6.13-2.6.19 (version 13 never saw a kernel

release). Some counters make more sense to be per-runqueue; other to be

per-domain. Note that domains (and their associated information) will only

be pertinent and available on machines utilizing CONFIG_SMP.

版本14的schedstats包含对sche_domains的支持,这正好和2.6.20内核模板

相同,虽然这和2.6.13-2.6.19内核中的版本号为14的schedstats中的数据也相同

(版本13的schedstats没有内核版本)。有些计数器作为per-runqueue会更有意义;

而有些作为per-domain更有意义。注意域(及其相关信息)只有在使用CONFIG_SMP

是才是相关和可用的。

In version 14 of schedstat, there is at least one level of domain

statistics for each cpu listed, and there may well be more than one

domain. Domains have no particular names in this implementation, but

the highest numbered one typically arbitrates balancing across all the

cpus on the machine, while domain0 is the most tightly focused domain,

sometimes balancing only between pairs of cpus. At this time, there

are no architectures which need more than three domain levels. The first

field in the domain stats is a bit map indicating which cpus are affected

by that domain.

在版本14的schedstat为每个列出的cpu分配了至少一个域统计信息,也有

可能是多个。在这个情况中域没有特定的名字,但一般顶级域为计算机

上的所有CPU仲裁平衡,然而域0是关注最密切的域名,可是有时只在两个CPU

之间仲裁平衡。此时,所有的架构所需要 的域等级不超过三个。填入域统计信息

中的是位映射,表明那些CPU受这个域名影响。

These fields are counters, and only increment. Programs which make use

of these will need to start with a baseline observation and then calculate

the change in the counters at each subsequent observation. A perl script

which does this for many of the fields is available at

http://eaglet.rain.com/rick/linux/schedstat/

这些字段是一些计数器,且只是增量。使用这些字段的程序需要运行一个基

线观测器,然后计算每个计数器中的变化。perl脚本描述了为许多字段怎样运行,你

可以访问 http://eaglet.rain.com/rick/linux/schedstat/。
Note that any such script will necessarily be version-specific, as the main

reason to change versions is changes in the output format. For those wishing

to write their own scripts, the fields are described here.

请注意,任何这样的脚本将必然是特定于版本的,这是由于版本改变的主要原因是

输出格式改变了。如果想要编写自己的脚本,这些字段如下描述。

CPU statistics

--------------

cpu<N> 1 2 3 4 5 6 7 8 9

First field is a sched_yield() statistic:

1) # of times sched_yield() was called

CPU 统计信息

--------------

cpu<N> 1 2 3 4 5 6 7 8 9

首字段是sched_yield()

1) #调用 sched_yield()

Next three are schedule() statistics:

2) This field is a legacy array expiration count field used in the O(1)

scheduler. We kept it for ABI compatibility, but it is always set to zero.

3) # of times schedule() was called

4) # of times schedule() left the processor idle

接下来三个字段是 schedule()统计信息:

2)这个字段是用于 O(1)调度器的遗留数组过期计数字段。我们一直为了ABI兼容性而保留它,但通常设置为0.

3)schedule()被调用

4)schedule()使处理器处于空闲状态

Next two are try_to_wake_up() statistics:

5) # of times try_to_wake_up() was called

6) # of times try_to_wake_up() was called to wake up the local cpu

接下来两个字段是try_to_wake_up()统计信息:

5)try_to_wake_up()被调用

6)try_to_wake_up()被调用,用于唤醒本地CPU

Next three are statistics describing scheduling latency:

7) sum of all time spent running by tasks on this processor (in jiffies)

8) sum of all time spent waiting to run by tasks on this processor (in

jiffies)

9) # of timeslices run on this cpu

接下来三个数据描述调度潜在因素:

7)这个处理器上的任务用于运行的总时间

8)这个处理器上的任务用于等待运行所花的总时间

Domain statistics

-----------------

One of these is produced per domain for each cpu described. (Note that if

CONFIG_SMP is not defined, *no* domains are utilized and these lines

will not appear in the output.)

域统计信息

每一个域将会为描述的每一个CPU产生一个统计信息。(注意如果没有定义

CONFIG_SMP,就没有使用域名,并且这些行将不会出现在输出中。)

domain<N> <cpumask> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

The first field is a bit mask indicating what cpus this domain operates over.

domain<N> <cpumask> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

第一个字段为1比特,表示这个域操控那个CPU。

The next 24 are a variety of load_balance() statistics in grouped into types

of idleness (idle, busy, and newly idle):

接下来的24个字段是各种load_balance()统计信息,它们是以字节分组的空闲状态(空闲,忙碌,和再空闲):

1) # of times in this domain load_balance() was called when the

cpu was idle

2) # of times in this domain load_balance() checked but found

the load did not require balancing when the cpu was idle

3) # of times in this domain load_balance() tried to move one or

more tasks and failed, when the cpu was idle

4) sum of imbalances discovered (if any) with each call to

load_balance() in this domain when the cpu was idle

5) # of times in this domain pull_task() was called when the cpu

was idle

6) # of times in this domain pull_task() was called even though

the target task was cache-hot when idle

7) # of times in this domain load_balance() was called but did

not find a busier queue while the cpu was idle

8) # of times in this domain a busier queue was found while the

cpu was idle but no busier group was found

9) # of times in this domain load_balance() was called when the

cpu was busy

10) # of times in this domain load_balance() checked but found the

load did not require balancing when busy

11) # of times in this domain load_balance() tried to move one or

more tasks and failed, when the cpu was busy

12) sum of imbalances discovered (if any) with each call to

load_balance() in this domain when the cpu was busy

13) # of times in this domain pull_task() was called when busy

14) # of times in this domain pull_task() was called even though the

target task was cache-hot when busy

15) # of times in this domain load_balance() was called but did not

find a busier queue while the cpu was busy

16) # of times in this domain a busier queue was found while the cpu

was busy but no busier group was found

17) # of times in this domain load_balance() was called when the

cpu was just becoming idle

18) # of times in this domain load_balance() checked but found the

load did not require balancing when the cpu was just becoming idle

19) # of times in this domain load_balance() tried to move one or more

tasks and failed, when the cpu was just becoming idle

20) sum of imbalances discovered (if any) with each call to

load_balance() in this domain when the cpu was just becoming idle

21) # of times in this domain pull_task() was called when newly idle

22) # of times in this domain pull_task() was called even though the

target task was cache-hot when just becoming idle

23) # of times in this domain load_balance() was called but did not

find a busier queue while the cpu was just becoming idle

24) # of times in this domain a busier queue was found while the cpu

was just becoming idle but no busier group was found

1)在这个域中,当CPU空闲时load_balance()被调用

2)当CPU空闲时检查load_balance(),但是发现load不需要平衡

3)load_balance()试图将一个或多个任务移动,但是失败,此时CPU空闲

4) 随着每一次调用load_balance(),在这个域里发现大量的不平衡(如果有的话),

此时CPU空闲

5) 在这个域名中,当CPU空闲时调用pull_task()

6) 当CPU空闲时,即使目标任务在缓冲中,pull_task()也被调用

7)在这个域中, load_balance()被调用,但是没发现一个更忙的队列,此时CPU处于

空闲状态

8)在这个域中发现一个更忙的队列,此时CPU处于空闲状态,但是没有发现更忙的组

9)在这个域中load_balance()被调用,此时CPU处于忙碌状态

10)在这个域中检查load_balance(),发现当CPU处于忙状态时不需要balancing

11)在这个域中,load_balance()试图转移一个或多个任务,但是失败,此时CPU处于忙碌状态

12)随着每一次调用load_balance(),在这个域名里发现大量的不平衡(如果有的话),

此时CPU处于忙碌状态

13)在这个域中,pull_task()被调用,此时CPU处于忙碌状态

14)在这个域中,即使目标任务处于缓冲忙状态,pull_task()也被调用,此时CPU

处于忙碌状态

15)在这个域中,load_balance() 被调用,但是没有发现一个更忙的队列,此时

CPU处于忙碌状态

16)在这个域中发现一个更忙的队列,此时CPU处于忙碌状态,但是没有发现更忙

的组

17)在这个域中,load_balance() 被调用,此时CPU刚刚回到空闲状态

18)在这个域中,检查load_balance() ,但是发现load不需要balancing,

此时CPU刚刚回到空闲状态

19)在这个域中,load_balance() 试图转移一个或多个任务,但是失败,

此时CPU刚刚回到空闲状态

20)在这个域中,随着每一次调用load_balance(),发现大量的不平衡(

如果有的话),此时CPU刚刚回到空闲状态

21)当这个域再空闲时, pull_task()被调用

22)在这个域中, pull_task()被调用,即使目标任务处于缓冲忙,此时CPU

刚刚回到空闲状态

23)在这个域中, load_balance()被调用,但是没有发现一个更忙的队列,

此时CPU刚刚回到空闲状态

24)在这个域中发现一个更忙的队列,此时CPU刚刚回到空闲状态,但是没有

发现一个更忙的组

Next three are active_load_balance() statistics:

25) # of times active_load_balance() was called

26) # of times active_load_balance() tried to move a task and failed

27) # of times active_load_balance() successfully moved a task

接下来3个字段是active_load_balance()统计信息:

25)active_load_balance()被调用

26)active_load_balance()试图转移一个任务,但是失败

27)active_load_balance()成功地转移一个任务

Next three are sched_balance_exec() statistics:

28) sbe_cnt is not used

29) sbe_balanced is not used

30) sbe_pushed is not used

接下来3个字段是 sched_balance_exec()统计信息:

28)没有使用sbe_cnt

29)没有使用sbe_balanced

30)没有使用sbe_pushed

Next three are sched_balance_fork() statistics:

31) sbf_cnt is not used

32) sbf_balanced is not used

33) sbf_pushed is not used

接下来3个字段是sched_balance_fork()统计信息:

31)没有使用sbf_cnt

32)没用使用sbf_balanced

33)没有使用sbf_pushed

Next three are try_to_wake_up() statistics:

34) # of times in this domain try_to_wake_up() awoke a task that

last ran on a different cpu in this domain

35) # of times in this domain try_to_wake_up() moved a task to the

waking cpu because it was cache-cold on its own cpu anyway

36) # of times in this domain try_to_wake_up() started passive balancing

接下来3个字段是 try_to_wake_up()统计信息:

34)在这个域名中,try_to_wake_up()唤醒一个在不同的CPU上运行的最后一

个任务

35)在这个域名中,try_to_wake_up()转移一个任务到被唤醒的CPU上,因为这

个任务在它所在的CPU上处于缓冲冷

36)在这个域名中,try_to_wake_up()开始启动被动的balancing

/proc/<pid>/schedstat

----------------

schedstats also adds a new /proc/<pid>/schedstat file to include some of

the same information on a per-process level. There are three fields in

this file correlating for that process to:

1) time spent on the cpu

2) time spent waiting on a runqueue

3) # of timeslices run on this cpu

/proc/<pid>/schedstat

----------------

schedstats也添加了一个新的/proc/<pid>/schedstat文件用于包含一些处于每一个进程

级别的相同信息。下面是这个文件中与每个进程相关的3个字段:

1)在CPU上所化的时间

2)用于等待运行队列的时间

3)在这个CPU上运行的时间片

A program could be easily written to make use of these extra fields to

report on how well a particular process or set of processes is faring

under the scheduler's policies. A simple version of such a program is

available at
http://eaglet.rain.com/rick/linux/schedstat/v12/latency.c
一个利用这些额外的字段的程序能够很容易的被创建,这个程序可以用来报告一个或

多个特殊的进程是在调度器制度下是怎样协调运行的。在

http://eaglet.rain.com/rick/linux/schedstat/v12/latency.c上有一个简单版本。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: