Feature request: implement D-state counter in top
Hey,
We've been using a hacked top since 2017 or so with a naive patch which adds a separate field for D-state processes to the tasks status line (and the corresponding logic).
After this improvement, top header looks like this:
top - 19:11:02 up 121 days, 23:10, 1 user, load average: 45.74, 49.19, 53.36
Threads: 2129 total, 4 running, 1586 sleeping, 0 stopped, 9 zombie, 42 d-state
%Cpu(s): 5.0 us, 4.2 sy, 1.0 ni, 70.2 id, 18.8 wa, 0.0 hi, 0.8 si, 0.0 st
MiB Mem : 257768.1 total, 16698.9 free, 92600.0 used, 148469.2 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 120975.5 avail Mem
The idea is to split unified "sleeping" counter into "sleeping" (interruptible wait) and "d-state" (uninterruptible sleep), which allows to distinguish between these states. This is extremely helpful when you log in to a busy host and want to get a hint about high load average, e.g. which kind of processes contribute to LA numbers. Without a separate D-state counter, comparing load average with running/sleeping/wa is a pure speculation.
The patch no longer applies since a lot has changed in procps in recent years (it was 3.3.12 back in 2017), and unfortunately I'm not even close to joining procps development yet.
Please consider implementing this, maybe managed by a new configure option (disabled by default probably).
Thanks.