1

when I run iotop, the second column "PRIO" shows ?err everywhere.

enter image description here

What does this mean? I did not find any mention of err in the manual page.

I am using custom compiled kernel. Could it be some option is missing in my kernel? How do I find which one?

EDIT

I have all the required options in my kernel:

CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_VM_EVENT_COUNTERS=y
400 the Cat
  • 819
  • 4
  • 37
  • 85

1 Answers1

3

How to find which kernel options are needed by iotop ? In the man pages :

CONFIG_TASK_DELAY_ACCT and CONFIG_TASK_IO_ACCOUNTING options need to be enabled in your Linux kernel build configuration, these options depend on CONFIG_TASKSTATS.

In other words, as part of the make menuconfig menu (of my 5.4), under the CPU/Task time and stats accounting sub-menu, you should check Export task/process statistics through netlink then Enable per-task delay accounting as well as Enable per-task storage I/O accounting

Won't hurt to also check CONFIG_VM_EVENT_COUNTERS (Enable VM event counters for /proc/vmstat in the General menu) Why ? Hah because there is some file named vmstat.c in the iotop package… so… just in case…

Adding that, at the end of the day, if whatever compulsory CONFIG option is missing, iotop should complain at run time.

I cannot tell if this is still valid under newer kernels but, on my 5.4 and probably because of some significant overhead, per-task delay accounting is not automatically activated despite CONFIG_TASK_DELAY_ACCT = y.
In order to actually enable per-task delay accounting, you also need to add delayacct to your kernel command line.


Now for what concerns the display of ?err : I suspect ncurses (the GUI toolkit iotop relies on) for being partly responsible since this lib usually displays as question marks characters that are not defined in your current language settings.
Hence, either you get some mismatches in your locale settings or… the PRIO value is somehow unprintable.

BTW, would you be using threaded IRQ's IOW running SCHED_RR ? I can admit that I hardly can figure out the output of get_ioprio_from_sched function (in ioprio.c) in case of whatever thread scheduled real time. (since, in this case, the nice value is just meaningless (even ps doesn't try displaying it) hence ioprio-nice and incidentally the return value depending on ioprio_nice.)

inline int get_ioprio_from_sched(pid_t pid) {
    int scheduler=sched_getscheduler(pid);
    int nice=getpriority(PRIO_PROCESS,pid);
    int ioprio_nice=(nice+20)/5;

    if (scheduler==SCHED_FIFO||scheduler==SCHED_RR)
        return (IOPRIO_CLASS_RT<<IOPRIO_CLASS_SHIFT)+ioprio_nice;
    if (scheduler==SCHED_IDLE)
        return IOPRIO_CLASS_IDLE<<IOPRIO_CLASS_SHIFT;
    return (IOPRIO_CLASS_BE<<IOPRIO_CLASS_SHIFT)+ioprio_nice;
}
MC68020
  • 6,281
  • 2
  • 13
  • 44
  • I have all the required kernel options enabled in my kernel. See update in my original question – 400 the Cat Apr 22 '22 at 11:22
  • @400theCat : Good ! and delayacct also added to kernel command line ? And BTW, please do answer my question regarding IRQs (threaded not threaded) – MC68020 Apr 22 '22 at 11:45