Bug 270789 - zpool list loads zfs.ko, even on systems that don't use zfs
Summary: zpool list loads zfs.ko, even on systems that don't use zfs
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-fs (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2023-04-12 14:34 UTC by Rubin Simons
Modified: 2023-12-01 18:52 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rubin Simons 2023-04-12 14:34:20 UTC
I noticed that zfs.ko got loaded unexpectedly on a few small systems I maintain, which don't run ZFS but only have UFS filesystems.

Turned out that btop executed "zpool list" unconditionally to find out if there are any ZFS pools available. This caused zfs.ko to be loaded, which in turn causes a "zfskern" process to spike all cpu cores at 100% for about 10 seconds.

I was discussing this with @nimaje on #freebsd on Libera and decided to file a bug. Our thinking was that probably, zpool and/or other zfs utilities should not auto-load zfs.ko at all.
Comment 1 Rubin Simons 2023-04-12 14:35:25 UTC
Upstream bug in btop about (indirectly) causing zfs.ko to be loaded because of unconditionally executing zpool list: https://github.com/aristocratos/btop/issues/515
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2023-04-12 17:10:52 UTC
From GitHub: 

> FreeBSD Os release version: 12.4-RELEASE-p1
Comment 3 Alan Somers freebsd_committer freebsd_triage 2023-04-12 17:26:24 UTC
This idea makes sense to me.  After all, if zfs.ko isn't already loaded, then there won't be any pools to list.  However, I think that "zpool import" and "zpool create" should still be able to load the module.  You should file a bug at https://github.com/openzfs/zfs .
Comment 4 Mina Galić freebsd_triage 2023-04-15 09:16:17 UTC
any updates on this?
I don't see any issue/pull requests on https://github.com/openzfs/zfs relating to it