2
2
Scheduler Statistics
3
3
====================
4
4
5
+ Version 17 of schedstats removed 'lb_imbalance' field as it has no
6
+ significance anymore and instead added more relevant fields namely
7
+ 'lb_imbalance_load', 'lb_imbalance_util', 'lb_imbalance_task' and
8
+ 'lb_imbalance_misfit'. The domain field prints the name of the
9
+ corresponding sched domain from this version onwards.
10
+
5
11
Version 16 of schedstats changed the order of definitions within
6
12
'enum cpu_idle_type', which changed the order of [CPU_MAX_IDLE_TYPES]
7
13
columns in show_schedstat(). In particular the position of CPU_IDLE
8
14
and __CPU_NOT_IDLE changed places. The size of the array is unchanged.
9
15
10
16
Version 15 of schedstats dropped counters for some sched_yield:
11
17
yld_exp_empty, yld_act_empty and yld_both_empty. Otherwise, it is
12
- identical to version 14.
18
+ identical to version 14. Details are available at
19
+
20
+ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/scheduler/sched-stats.txt?id=1e1dbb259c79b
13
21
14
22
Version 14 of schedstats includes support for sched_domains, which hit the
15
23
mainline kernel in 2.6.20 although it is identical to the stats from version
@@ -26,7 +34,14 @@ cpus on the machine, while domain0 is the most tightly focused domain,
26
34
sometimes balancing only between pairs of cpus. At this time, there
27
35
are no architectures which need more than three domain levels. The first
28
36
field in the domain stats is a bit map indicating which cpus are affected
29
- by that domain.
37
+ by that domain. Details are available at
38
+
39
+ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/sched-stats.txt?id=b762f3ffb797c
40
+
41
+ The schedstat documentation is maintained version 10 onwards and is not
42
+ updated for version 11 and 12. The details for version 10 are available at
43
+
44
+ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/sched-stats.txt?id=1da177e4c3f4
30
45
31
46
These fields are counters, and only increment. Programs which make use
32
47
of these will need to start with a baseline observation and then calculate
@@ -71,88 +86,97 @@ Domain statistics
71
86
-----------------
72
87
One of these is produced per domain for each cpu described. (Note that if
73
88
CONFIG_SMP is not defined, *no * domains are utilized and these lines
74
- will not appear in the output.)
89
+ will not appear in the output. <name> is an extension to the domain field
90
+ that prints the name of the corresponding sched domain. It can appear in
91
+ schedstat version 17 and above, and requires CONFIG_SCHED_DEBUG.)
75
92
76
- 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
93
+ domain<N> <name> < 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 37 38 39 40 41 42 43 44 45
77
94
78
95
The first field is a bit mask indicating what cpus this domain operates over.
79
96
80
- The next 24 are a variety of sched_balance_rq() statistics in grouped into types
81
- of idleness (idle, busy, and newly idle):
97
+ The next 33 are a variety of sched_balance_rq() statistics in grouped into types
98
+ of idleness (busy, idle and newly idle):
82
99
83
100
1) # of times in this domain sched_balance_rq() was called when the
101
+ cpu was busy
102
+ 2) # of times in this domain sched_balance_rq() checked but found the
103
+ load did not require balancing when busy
104
+ 3) # of times in this domain sched_balance_rq() tried to move one or
105
+ more tasks and failed, when the cpu was busy
106
+ 4) Total imbalance in load when the cpu was busy
107
+ 5) Total imbalance in utilization when the cpu was busy
108
+ 6) Total imbalance in number of tasks when the cpu was busy
109
+ 7) Total imbalance due to misfit tasks when the cpu was busy
110
+ 8) # of times in this domain pull_task() was called when busy
111
+ 9) # of times in this domain pull_task() was called even though the
112
+ target task was cache-hot when busy
113
+ 10) # of times in this domain sched_balance_rq() was called but did not
114
+ find a busier queue while the cpu was busy
115
+ 11) # of times in this domain a busier queue was found while the cpu
116
+ was busy but no busier group was found
117
+
118
+ 12) # of times in this domain sched_balance_rq() was called when the
84
119
cpu was idle
85
- 2) # of times in this domain sched_balance_rq() checked but found
120
+ 13) # of times in this domain sched_balance_rq() checked but found
86
121
the load did not require balancing when the cpu was idle
87
- 3) # of times in this domain sched_balance_rq() tried to move one or
122
+ 14) # of times in this domain sched_balance_rq() tried to move one or
88
123
more tasks and failed, when the cpu was idle
89
- 4) sum of imbalances discovered (if any) with each call to
90
- sched_balance_rq() in this domain when the cpu was idle
91
- 5) # of times in this domain pull_task() was called when the cpu
124
+ 15) Total imbalance in load when the cpu was idle
125
+ 16) Total imbalance in utilization when the cpu was idle
126
+ 17) Total imbalance in number of tasks when the cpu was idle
127
+ 18) Total imbalance due to misfit tasks when the cpu was idle
128
+ 19) # of times in this domain pull_task() was called when the cpu
92
129
was idle
93
- 6) # of times in this domain pull_task() was called even though
130
+ 20) # of times in this domain pull_task() was called even though
94
131
the target task was cache-hot when idle
95
- 7) # of times in this domain sched_balance_rq() was called but did
132
+ 21) # of times in this domain sched_balance_rq() was called but did
96
133
not find a busier queue while the cpu was idle
97
- 8) # of times in this domain a busier queue was found while the
134
+ 22) # of times in this domain a busier queue was found while the
98
135
cpu was idle but no busier group was found
99
- 9) # of times in this domain sched_balance_rq() was called when the
100
- cpu was busy
101
- 10) # of times in this domain sched_balance_rq() checked but found the
102
- load did not require balancing when busy
103
- 11) # of times in this domain sched_balance_rq() tried to move one or
104
- more tasks and failed, when the cpu was busy
105
- 12) sum of imbalances discovered (if any) with each call to
106
- sched_balance_rq() in this domain when the cpu was busy
107
- 13) # of times in this domain pull_task() was called when busy
108
- 14) # of times in this domain pull_task() was called even though the
109
- target task was cache-hot when busy
110
- 15) # of times in this domain sched_balance_rq() was called but did not
111
- find a busier queue while the cpu was busy
112
- 16) # of times in this domain a busier queue was found while the cpu
113
- was busy but no busier group was found
114
136
115
- 17 ) # of times in this domain sched_balance_rq() was called when the
116
- cpu was just becoming idle
117
- 18 ) # of times in this domain sched_balance_rq() checked but found the
137
+ 23 ) # of times in this domain sched_balance_rq() was called when the
138
+ was just becoming idle
139
+ 24 ) # of times in this domain sched_balance_rq() checked but found the
118
140
load did not require balancing when the cpu was just becoming idle
119
- 19 ) # of times in this domain sched_balance_rq() tried to move one or more
141
+ 25 ) # of times in this domain sched_balance_rq() tried to move one or more
120
142
tasks and failed, when the cpu was just becoming idle
121
- 20) sum of imbalances discovered (if any) with each call to
122
- sched_balance_rq() in this domain when the cpu was just becoming idle
123
- 21) # of times in this domain pull_task() was called when newly idle
124
- 22) # of times in this domain pull_task() was called even though the
143
+ 26) Total imbalance in load when the cpu was just becoming idle
144
+ 27) Total imbalance in utilization when the cpu was just becoming idle
145
+ 28) Total imbalance in number of tasks when the cpu was just becoming idle
146
+ 29) Total imbalance due to misfit tasks when the cpu was just becoming idle
147
+ 30) # of times in this domain pull_task() was called when newly idle
148
+ 31) # of times in this domain pull_task() was called even though the
125
149
target task was cache-hot when just becoming idle
126
- 23 ) # of times in this domain sched_balance_rq() was called but did not
150
+ 32 ) # of times in this domain sched_balance_rq() was called but did not
127
151
find a busier queue while the cpu was just becoming idle
128
- 24 ) # of times in this domain a busier queue was found while the cpu
152
+ 33 ) # of times in this domain a busier queue was found while the cpu
129
153
was just becoming idle but no busier group was found
130
154
131
155
Next three are active_load_balance() statistics:
132
156
133
- 25 ) # of times active_load_balance() was called
134
- 26 ) # of times active_load_balance() tried to move a task and failed
135
- 27 ) # of times active_load_balance() successfully moved a task
157
+ 34 ) # of times active_load_balance() was called
158
+ 35 ) # of times active_load_balance() tried to move a task and failed
159
+ 36 ) # of times active_load_balance() successfully moved a task
136
160
137
161
Next three are sched_balance_exec() statistics:
138
162
139
- 28 ) sbe_cnt is not used
140
- 29 ) sbe_balanced is not used
141
- 30 ) sbe_pushed is not used
163
+ 37 ) sbe_cnt is not used
164
+ 38 ) sbe_balanced is not used
165
+ 39 ) sbe_pushed is not used
142
166
143
167
Next three are sched_balance_fork() statistics:
144
168
145
- 31 ) sbf_cnt is not used
146
- 32 ) sbf_balanced is not used
147
- 33 ) sbf_pushed is not used
169
+ 40 ) sbf_cnt is not used
170
+ 41 ) sbf_balanced is not used
171
+ 42 ) sbf_pushed is not used
148
172
149
173
Next three are try_to_wake_up() statistics:
150
174
151
- 34 ) # of times in this domain try_to_wake_up() awoke a task that
175
+ 43 ) # of times in this domain try_to_wake_up() awoke a task that
152
176
last ran on a different cpu in this domain
153
- 35 ) # of times in this domain try_to_wake_up() moved a task to the
177
+ 44 ) # of times in this domain try_to_wake_up() moved a task to the
154
178
waking cpu because it was cache-cold on its own cpu anyway
155
- 36 ) # of times in this domain try_to_wake_up() started passive balancing
179
+ 45 ) # of times in this domain try_to_wake_up() started passive balancing
156
180
157
181
/proc/<pid>/schedstat
158
182
---------------------
0 commit comments