Hello Dave,
Currently, runq command doesn't show tasks in throttled cfs_rqs/rt_rqs,
but sometimes we want to display them to help us find the problem. So
I made the patches to make them displayed.
Two patches are attached. and PATCH2 should be applied after PATCH1.
PATCH1: 0001-runq-make-tasks-in-cfs_rq-displayed-hierarchically.patch
this patch is used to change the original display of the cfs_rq tasks.
for example, before applying PATCH1, the display is:
CPU 2 RUNQUEUE: ffff88002c316680
CURRENT: PID: 4274 TASK: ffff88013aa2eae0 COMMAND: "sh"
RT PRIO_ARRAY: ffff88002c316808
[no tasks queued]
CFS RB_ROOT: ffff88002c316718
[120] PID: 4296 TASK: ffff88010916d540 COMMAND: "sh"
[120] PID: 4258 TASK: ffff880135c5eaa0 COMMAND: "sh"
[120] PID: 4270 TASK: ffff88013aeb6aa0 COMMAND: "sh"
[120] PID: 4268 TASK: ffff88013b6b4040 COMMAND: "sh"
[120] PID: 4272 TASK: ffff88013a918080 COMMAND: "sh"
[120] PID: 4280 TASK: ffff880109028080 COMMAND: "sh"
[120] PID: 4276 TASK: ffff8801388fa080 COMMAND: "sh"
[120] PID: 4278 TASK: ffff880109029540 COMMAND: "sh"
[120] PID: 4260 TASK: ffff88013aeeeae0 COMMAND: "sh"
[130] PID: 4335 TASK: ffff88011ac3d500 COMMAND: "sosreport"
[120] PID: 4284 TASK: ffff8801050a7540 COMMAND: "sh"
[120] PID: 4286 TASK: ffff8801050a6080 COMMAND: "sh"
[120] PID: 4282 TASK: ffff88011ac48aa0 COMMAND: "sh"
[120] PID: 4290 TASK: ffff8801041f7540 COMMAND: "sh"
[120] PID: 4288 TASK: ffff880121530aa0 COMMAND: "sh"
[120] PID: 4292 TASK: ffff8801041f6080 COMMAND: "sh"
[120] PID: 4262 TASK: ffff880137b21500 COMMAND: "sh"
[120] PID: 4266 TASK: ffff88011aeb4aa0 COMMAND: "sh"
[120] PID: 4264 TASK: ffff88010400b540 COMMAND: "sh"
after applying PATCH1, the display is changed to:
CPU 2 RUNQUEUE: ffff88002c316680
CURRENT: PID: 4274 TASK: ffff88013aa2eae0 COMMAND: "sh"
RT PRIO_ARRAY: ffff88002c316808
[no tasks queued]
CFS RB_ROOT: ffff88002c316718
[120] PID: 4296 TASK: ffff88010916d540 COMMAND: "sh"
[120] PID: 4258 TASK: ffff880135c5eaa0 COMMAND: "sh"
GROUP CFS RB_ROOT: ffff880138f50200 <test1>
GROUP CFS RB_ROOT: ffff88001f8d1e00 <test11>
[120] PID: 4270 TASK: ffff88013aeb6aa0 COMMAND: "sh"
[120] PID: 4268 TASK: ffff88013b6b4040 COMMAND: "sh"
[120] PID: 4272 TASK: ffff88013a918080 COMMAND: "sh"
GROUP CFS RB_ROOT: ffff88013a1ba200 <test12>
[120] PID: 4280 TASK: ffff880109028080 COMMAND: "sh"
[120] PID: 4276 TASK: ffff8801388fa080 COMMAND: "sh"
[120] PID: 4278 TASK: ffff880109029540 COMMAND: "sh"
[120] PID: 4260 TASK: ffff88013aeeeae0 COMMAND: "sh"
[130] PID: 4335 TASK: ffff88011ac3d500 COMMAND: "sosreport"
GROUP CFS RB_ROOT: ffff88013bb75400 <test2>
GROUP CFS RB_ROOT: ffff8801381f1000 <test21>
[120] PID: 4284 TASK: ffff8801050a7540 COMMAND: "sh"
[120] PID: 4286 TASK: ffff8801050a6080 COMMAND: "sh"
[120] PID: 4282 TASK: ffff88011ac48aa0 COMMAND: "sh"
GROUP CFS RB_ROOT: ffff88001f816000 <test22>
[120] PID: 4290 TASK: ffff8801041f7540 COMMAND: "sh"
[120] PID: 4288 TASK: ffff880121530aa0 COMMAND: "sh"
[120] PID: 4292 TASK: ffff8801041f6080 COMMAND: "sh"
[120] PID: 4262 TASK: ffff880137b21500 COMMAND: "sh"
[120] PID: 4266 TASK: ffff88011aeb4aa0 COMMAND: "sh"
[120] PID: 4264 TASK: ffff88010400b540 COMMAND: "sh"
PACTH2: 0002-runq-make-tasks-in-throttled-cfs_rqs-rt_rqs-displaye.patch
this patch is used to display tasks in throttled cfs_rqs and rt_rqs.
for example, before applying PATCH2:
CPU 1 RUNQUEUE: ffff88002c296680
CURRENT: PID: 3494 TASK: ffff88011bcaa080 COMMAND: "sh"
RT PRIO_ARRAY: ffff88002c296808
[no tasks queued]
CFS RB_ROOT: ffff88002c296718
[120] PID: 3516 TASK: ffff88011bfdd500 COMMAND: "sh"
[120] PID: 3514 TASK: ffff88011bef2ae0 COMMAND: "sh"
after applying PATCH2:
CPU 1 RUNQUEUE: ffff88002c296680
CURRENT: PID: 3494 TASK: ffff88011bcaa080 COMMAND: "sh"
RT PRIO_ARRAY: ffff88002c296808
[ 0] GROUP RT PRIO_ARRAY: ffff88013b351800 <test1> (THROTTLED)
[ 0] GROUP RT PRIO_ARRAY: ffff88013acdb800 <test11>
[ 0] PID: 3546 TASK: ffff88010d05e040 COMMAND: "rtloop99"
[ 1] PID: 3541 TASK: ffff88011bef2080 COMMAND: "rtloop98"
[ 54] PID: 3536 TASK: ffff88011bf28080 COMMAND: "rtloop45"
[ 98] PID: 3530 TASK: ffff88013ab1aaa0 COMMAND: "rtloop1"
[ 1] PID: 3540 TASK: ffff88011bf29540 COMMAND: "rtloop98"
[ 54] PID: 3534 TASK: ffff88013ab14040 COMMAND: "rtloop45"
[ 54] GROUP RT PRIO_ARRAY: ffff88013a207800 <test12>
[ 54] PID: 3537 TASK: ffff88013a378ae0 COMMAND: "rtloop45"
[ 98] PID: 3531 TASK: ffff88011bdae080 COMMAND: "rtloop1"
CFS RB_ROOT: ffff88002c296718
[120] PID: 3516 TASK: ffff88011bfdd500 COMMAND: "sh"
[120] PID: 3514 TASK: ffff88011bef2ae0 COMMAND: "sh"
Another example to show the throttled tasks in cfs_rqs:
CPU 1 RUNQUEUE: ffff880028296680
CURRENT: PID: 7814 TASK: ffff880117bab500 COMMAND: "sh"
RT PRIO_ARRAY: ffff880028296808
[no tasks queued]
CFS RB_ROOT: ffff880028296718
[120] PID: 2619 TASK: ffff88013812c040 COMMAND: "Xorg"
......
[120] PID: 7798 TASK: ffff88013a39eae0 COMMAND: "sh"
GROUP CFS RB_ROOT: ffff880135fc6800 <test1> (DEQUEUED)
GROUP CFS RB_ROOT: ffff88000ce5bc00 <test12> (THROTTLED)
[120] PID: 7820 TASK: ffff8801383ab500 COMMAND: "sh"
[120] PID: 7818 TASK: ffff88013ba14ae0 COMMAND: "sh"
[120] PID: 7816 TASK: ffff880117baa040 COMMAND: "sh"
GROUP CFS RB_ROOT: ffff880135fc6800 <test1> (DEQUEUED)
GROUP CFS RB_ROOT: ffff8800b0b32000 <test11> (THROTTLED)
[120] PID: 7810 TASK: ffff8800b0b96aa0 COMMAND: "sh"
*NOTE*
1. The patch also displays the group name that the cfs_rq/rt_rq belows to.
2. There are two statuses about the rqs: DEQUEUED and THROTTLED.
THROTTLED means this cfs_rq/rt_rq is throttled. And DEQUEUED means the
running entities in the rq are 0 because no running task on it and its
child rqs are throttled.
Thanks
Zhang Yanfei