** Description changed:

+ [ Impact ]
+ The arc_summary command doesn't work on HWE kernels for Focal
+ 
+ [ Test Plan ]
+ 1) setup 20.04 with HWE kernel 5.15
+ 2) install `zfsutils-linux`
+ 3) run `arc_summary`, this should not cause any errors
+ 
+ $ arc_summary
+ Traceback (most recent call last):
+   File "/usr/sbin/arc_summary", line 875, in <module>
+     main()
+   File "/usr/sbin/arc_summary", line 826, in main
+     kstats = get_kstats()
+   File "/usr/sbin/arc_summary", line 259, in get_kstats
+     with open(PROC_PATH+section, 'r') as proc_location:
+ FileNotFoundError: [Errno 2] No such file or directory: 
'/proc/spl/kstat/zfs/xuio_stats'
+ 
+ [ Where problems could occur ]
+ Given that upstream does not have to deal with two kernel versions like 
Ubuntu (GA vs HWE), our SAUCE patch will skip any non-existent files under 
/proc/spl/kstat/zfs. This ensures that arc_summary works as expected under both 
GA and HWE kernels.
+ 
+ Users expecting the HWE kernel to contain output from xuio_stats like we
+ had in GA will not see it in the ARC summary output. Any new stats that
+ get introduced into the HWE kernel will also be skipped due to this
+ patch, if they're missing from the GA kernel.
+ 
+ --
  # Issue description
  
  `arc_summary` no longer works with kernel 5.15. It used to work with
  previous kernel like 5.13.
  
  # Steps to reproduce
  
  1) setup 20.04 with HWE kernel 5.15
  2) install `zfsutils-linux`
  3) run `arc_summary`
- $ arc_summary 
+ $ arc_summary
  Traceback (most recent call last):
-   File "/usr/sbin/arc_summary", line 875, in <module>
-     main()
-   File "/usr/sbin/arc_summary", line 826, in main
-     kstats = get_kstats()
-   File "/usr/sbin/arc_summary", line 259, in get_kstats
-     with open(PROC_PATH+section, 'r') as proc_location:
+   File "/usr/sbin/arc_summary", line 875, in <module>
+     main()
+   File "/usr/sbin/arc_summary", line 826, in main
+     kstats = get_kstats()
+   File "/usr/sbin/arc_summary", line 259, in get_kstats
+     with open(PROC_PATH+section, 'r') as proc_location:
  FileNotFoundError: [Errno 2] No such file or directory: 
'/proc/spl/kstat/zfs/xuio_stats'
- 
  
  Indeed, the xuio_stats file isn't there anymore:
  $ ll /proc/spl/kstat/zfs/
  total 0
  dr-xr-xr-x 21 root root 0 Jul  6 10:49 ./
  dr-xr-xr-x  4 root root 0 Jul  6 10:49 ../
  -rw-r--r--  1 root root 0 Jul  6 10:49 abdstats
  -rw-r--r--  1 root root 0 Jul  6 10:49 arcstats
  dr-xr-xr-x 20 root root 0 Jul  6 10:49 data/
  -rw-------  1 root root 0 Jul  6 10:49 dbgmsg
  -rw-------  1 root root 0 Jul  6 10:49 dbufs
  -rw-r--r--  1 root root 0 Jul  6 10:49 dbufstats
  dr-xr-xr-x 70 root root 0 Jul  6 10:49 default/
  -rw-r--r--  1 root root 0 Jul  6 10:49 dmu_tx
  -rw-r--r--  1 root root 0 Jul  6 10:49 dnodestats
  -rw-r--r--  1 root root 0 Jul  6 10:49 fletcher_4_bench
  -rw-r--r--  1 root root 0 Jul  6 10:49 fm
  -rw-r--r--  1 root root 0 Jul  6 10:49 import_progress
  -rw-r--r--  1 root root 0 Jul  6 10:49 metaslab_stats
  -rw-r--r--  1 root root 0 Jul  6 10:49 vdev_cache_stats
  -rw-r--r--  1 root root 0 Jul  6 10:49 vdev_mirror_stats
  -rw-r--r--  1 root root 0 Jul  6 10:49 vdev_raidz_bench
  -rw-r--r--  1 root root 0 Jul  6 10:49 zfetchstats
  -rw-r--r--  1 root root 0 Jul  6 10:49 zil
  -rw-r--r--  1 root root 0 Jul  6 10:49 zstd
  
- 
  # Workaround
  
  This (naive) patch sidesteps the problem:
  
  $ diff -Naur /usr/sbin/arc_summary.old /usr/sbin/arc_summary
  --- /usr/sbin/arc_summary.old 2022-07-06 10:59:50.752833101 -0400
  +++ /usr/sbin/arc_summary     2022-07-06 10:59:22.449113169 -0400
  @@ -255,6 +255,8 @@
-      secs = SECTION_PATHS.values()
-  
-      for section in secs:
+      secs = SECTION_PATHS.values()
+ 
+      for section in secs:
  +        if not os.path.exists(PROC_PATH+section):
  +            continue
-  
-          with open(PROC_PATH+section, 'r') as proc_location:
-              lines = [line for line in proc_location]
  
+          with open(PROC_PATH+section, 'r') as proc_location:
+              lines = [line for line in proc_location]
  
  # Additional information
  $ lsb_release -rd
  Description:  Ubuntu 20.04.4 LTS
  Release:      20.04
  $ uname -r
  5.15.0-41-generic
  $ apt-cache policy zfsutils-linux linux-image-generic-hwe-20.04
  zfsutils-linux:
-   Installed: 0.8.3-1ubuntu12.14
-   Candidate: 0.8.3-1ubuntu12.14
-   Version table:
-  *** 0.8.3-1ubuntu12.14 500
-         500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 
Packages
-         100 /var/lib/dpkg/status
-      0.8.3-1ubuntu12.9 500
-         500 http://security.ubuntu.com/ubuntu focal-security/main amd64 
Packages
-      0.8.3-1ubuntu12 500
-         500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
+   Installed: 0.8.3-1ubuntu12.14
+   Candidate: 0.8.3-1ubuntu12.14
+   Version table:
+  *** 0.8.3-1ubuntu12.14 500
+         500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 
Packages
+         100 /var/lib/dpkg/status
+      0.8.3-1ubuntu12.9 500
+         500 http://security.ubuntu.com/ubuntu focal-security/main amd64 
Packages
+      0.8.3-1ubuntu12 500
+         500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
  linux-image-generic-hwe-20.04:
-   Installed: 5.15.0.41.44~20.04.13
-   Candidate: 5.15.0.41.44~20.04.13
-   Version table:
-  *** 5.15.0.41.44~20.04.13 400
-         400 http://us.archive.ubuntu.com/ubuntu focal-proposed/main amd64 
Packages
-         100 /var/lib/dpkg/status
-      5.13.0.52.59~20.04.31 500
-         500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 
Packages
-         500 http://security.ubuntu.com/ubuntu focal-security/main amd64 
Packages
-      5.4.0.26.32 500
-         500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
+   Installed: 5.15.0.41.44~20.04.13
+   Candidate: 5.15.0.41.44~20.04.13
+   Version table:
+  *** 5.15.0.41.44~20.04.13 400
+         400 http://us.archive.ubuntu.com/ubuntu focal-proposed/main amd64 
Packages
+         100 /var/lib/dpkg/status
+      5.13.0.52.59~20.04.31 500
+         500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 
Packages
+         500 http://security.ubuntu.com/ubuntu focal-security/main amd64 
Packages
+      5.4.0.26.32 500
+         500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1980848

Title:
  arc_summary doesn't work with HWE kernel 5.15

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1980848/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to