Commit 05ea841
runqslower: create sufficiently large array table to avoid missing tasks
We have encountered an issue while running runqslower for long run test,
as you can check the log below. The workload of target platform is
running auto test script and launching lots of applications periodically
on Android TV. There are several abnormal records of run queue latency,
ex. 1311763801.
We have investgated this issue and found the root cuase of this issue is
the hash map to store en-queue start time of each task overflowed, and
it seems cpudist also encountered such issue before and fix by following
pull request.
iovisor#2568
Apply the similar fix to runqslower, getting the max_pid from
/proc/sys/kernel/max_pid and pass to BPF C in kernel to create enough
entries of BPF map to store en-queue start time of each task.
In the mean time, since we create the BPF map with max_pid entries, use
BPF_ARRAY instead of BPF_HASH to prevent collision.
```
(bcc)root@localhost:/# runqslower 100000 -P
Tracing run queue latency higher than 100000 us
TIME COMM TID LAT(us) PREV COMM PREV TID
23:42:45 glide-source-th 28986 161605 kworker/u9:3 12260
23:42:50 HTTPREQUEST_MAN 26249 107187 OMX_VideoInput 7152
23:42:50 migration/2 24 146799 OmxSideband 7147
23:42:50 rtk_post_worker 128 174145 migration/2 24
23:42:50 Binder:233_4 633 170457 runqslower 7086
23:42:58 GIBBON_SURFACE_ 26233 103377 composer@2.4-se 457
23:43:14 Binder:581_1B 2202 113153 Binder:581_7 833
23:43:24 migration/0 15 107716 writer 7277
....
05:08:14 dumpLogs.sh 22242 1311763801 NBP_POOL-[1] 24233
05:08:14 dumpLogs.sh 22243 1311752373 appsrc7:src 24281
05:08:14 dumpLogs.sh 22248 1311760825 dumpLogs.sh 22193
```
Signed-off-by: Ism Hong <ism.hong@realtek.com>1 parent 2057146 commit 05ea841
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
268 | 270 | | |
269 | 271 | | |
270 | | - | |
| 272 | + | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| |||
0 commit comments