Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-16345

iotop shows "?unavailable?" for SWAPIN and IO fields on RHEL8

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • iotop-0.6-18.el8
    • Yes
    • Moderate
    • Regression
    • None
    • ssg_core_services
    • 18
    • 22
    • 2
    • QE ack
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • Red Hat Enterprise Linux
    • None
    • None

      What were you trying to do that didn't work?

      Executing the following command, the fields SWAPIN and IO are always ?unavailable?:

       

      # iotop -b -n 1
      Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
      Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
          TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
      b'      1 be/4 root        0.00 B/s    0.00 B/s ?unavailable?  systemd --switched-root --system --deserialize 17'
      b'      2 be/4 root        0.00 B/s    0.00 B/s ?unavailable?  [kthreadd]'
      [...] 

      The root cause for this is a bad test made to detect whether delayacct is enabled or not (/usr/lib/python3.6/site-packages/iotop/data.py):

      457 def sysctl_task_delayacct():
      458     try:
      459         with open('/proc/sys/kernel/task_delayacct') as f:
      460             return bool(int(f.read().strip()))
      461     except FileNotFoundError:
      462         return None
      

      Because /proc/sys/kernel/task_delayacct doesn't exist on RHEL8, it always returns None, which is equivalent to False in the end.

      On RHEL8, delayacct_on kernel variable is enabled by default (excerpt of kernel/delayacct.c):

       26 int delayacct_on __read_mostly = 1;     /* Delay accounting turned on/off */
       27 EXPORT_SYMBOL_GPL(delayacct_on);
       28 struct kmem_cache *delayacct_cache;
       29 
       30 static int __init delayacct_setup_disable(char *str)
       31 {
       32         delayacct_on = 0;
       33         return 1;
       34 }
       35 __setup("nodelayacct", delayacct_setup_disable); 

      Hence the proper condition should be the following Python snippet instead:

       21 from procfs import cmdline
      [...]
      458 def sysctl_task_delayacct():
      459     return 'nodelayacct' not in cmdline().keys()

      Please provide the package NVR for which bug is seen:

      iotop-0.6-17.el8.noarch (REGRESSION compared to iotop-0.6-16.el8.noarch)

      How reproducible:

      Always, just execute "iotop -b -n 1" on RHEL8

              mhlavink Michal Hlavinka
              rhn-support-rmetrich Renaud Métrich
              Michal Hlavinka Michal Hlavinka
              Evgeny Fedin Evgeny Fedin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: