Skip to content

Commit ec710aa

Browse files
wangyongtorvalds
authored andcommitted
Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact
Add thrashing page cache and direct compact related descriptions and update the usage of getdelays userspace utility. The following patches modifications have been updated: https://lore.kernel.org/all/[email protected]/ https://lore.kernel.org/all/1638619795-71451-1-git-send-email- [email protected]/ Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: wangyong <[email protected]> Reviewed-by: Yang Yang <[email protected]> Reported-by: Zeal Robot <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1193829 commit ec710aa

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

Documentation/accounting/delay-accounting.rst

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ a) waiting for a CPU (while being runnable)
1313
b) completion of synchronous block I/O initiated by the task
1414
c) swapping in pages
1515
d) memory reclaim
16+
e) thrashing page cache
17+
f) direct compact
1618

1719
and makes these statistics available to userspace through
1820
the taskstats interface.
@@ -41,11 +43,12 @@ generic data structure to userspace corresponding to per-pid and per-tgid
4143
statistics. The delay accounting functionality populates specific fields of
4244
this structure. See
4345

44-
include/linux/taskstats.h
46+
include/uapi/linux/taskstats.h
4547

4648
for a description of the fields pertaining to delay accounting.
4749
It will generally be in the form of counters returning the cumulative
48-
delay seen for cpu, sync block I/O, swapin, memory reclaim etc.
50+
delay seen for cpu, sync block I/O, swapin, memory reclaim, thrash page
51+
cache, direct compact etc.
4952

5053
Taking the difference of two successive readings of a given
5154
counter (say cpu_delay_total) for a task will give the delay
@@ -88,41 +91,37 @@ seen.
8891

8992
General format of the getdelays command::
9093

91-
getdelays [-t tgid] [-p pid] [-c cmd...]
92-
94+
getdelays [-dilv] [-t tgid] [-p pid]
9395

9496
Get delays, since system boot, for pid 10::
9597

96-
# ./getdelays -p 10
98+
# ./getdelays -d -p 10
9799
(output similar to next case)
98100

99101
Get sum of delays, since system boot, for all pids with tgid 5::
100102

101-
# ./getdelays -t 5
102-
103-
104-
CPU count real total virtual total delay total
105-
7876 92005750 100000000 24001500
106-
IO count delay total
107-
0 0
108-
SWAP count delay total
109-
0 0
110-
RECLAIM count delay total
111-
0 0
103+
# ./getdelays -d -t 5
104+
print delayacct stats ON
105+
TGID 5
112106

113-
Get delays seen in executing a given simple command::
114107

115-
# ./getdelays -c ls /
108+
CPU count real total virtual total delay total delay average
109+
8 7000000 6872122 3382277 0.423ms
110+
IO count delay total delay average
111+
0 0 0ms
112+
SWAP count delay total delay average
113+
0 0 0ms
114+
RECLAIM count delay total delay average
115+
0 0 0ms
116+
THRASHING count delay total delay average
117+
0 0 0ms
118+
COMPACT count delay total delay average
119+
0 0 0ms
116120

117-
bin data1 data3 data5 dev home media opt root srv sys usr
118-
boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var
121+
Get IO accounting for pid 1, it works only with -p::
119122

123+
# ./getdelays -i -p 1
124+
printing IO accounting
125+
linuxrc: read=65536, write=0, cancelled_write=0
120126

121-
CPU count real total virtual total delay total
122-
6 4000250 4000000 0
123-
IO count delay total
124-
0 0
125-
SWAP count delay total
126-
0 0
127-
RECLAIM count delay total
128-
0 0
127+
The above command can be used with -v to get more debug information.

0 commit comments

Comments
 (0)