Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etc/systemd/zfs-mount-generator: rewrite in C #11917

Closed
wants to merge 2 commits into from

Conversation

nabijaczleweli
Copy link
Contributor

@nabijaczleweli nabijaczleweli commented Apr 19, 2021

Motivation and Context

A 300ms generator is, uh, yeah, as previously mentioned in #11915, so I spent a great 14 hours on Saturday and a few more yesterday writing this.

Description

A plain rewrite of the shell version; the first commit generates identical units, save for replacing some empty lines with nothing, having fewer meaningless spaces in After=s and being slightly more verbose with spaces in the unlock scripts. The second cleans it up slightly.

This also properly deals with canmount=noauto units across multiple pools.

The most exciting results come from the two ZFS-on-root systems because they have an encrypted root dataset:

diff --git a/upstream-default/-.mount b/zmgzmgzm-default/-.mount
index 87ee404..a390afc 100644
--- a/upstream-default/-.mount
+++ b/zmgzmgzm-default/-.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/
 What=babzoot/root
diff --git a/upstream-default/boot.mount b/zmgzmgzm-default/boot.mount
index 22a9b0f..2ba69ac 100644
--- a/upstream-default/boot.mount
+++ b/zmgzmgzm-default/boot.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/boot
 What=babzoot/boot
diff --git a/upstream-default/home-nabijaczleweli-.cargo.mount b/zmgzmgzm-default/home-nabijaczleweli-.cargo.mount
index be1f595..c4e1728 100644
--- a/upstream-default/home-nabijaczleweli-.cargo.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli-.cargo.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/.cargo
 What=babzoot/home/nabijaczleweli/.cargo
diff --git a/upstream-default/home-nabijaczleweli-.wine.mount b/zmgzmgzm-default/home-nabijaczleweli-.wine.mount
index 0a1bdbc..4390de0 100644
--- a/upstream-default/home-nabijaczleweli-.wine.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli-.wine.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/.wine
 What=babzoot/home/nabijaczleweli/.wine
diff --git "a/upstream-default/home-nabijaczleweli-.wine\\x2d32.mount" "b/zmgzmgzm-default/home-nabijaczleweli-.wine\\x2d32.mount"
index 317a44a..88f5569 100644
--- "a/upstream-default/home-nabijaczleweli-.wine\\x2d32.mount"
+++ "b/zmgzmgzm-default/home-nabijaczleweli-.wine\\x2d32.mount"
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/.wine-32
 What=babzoot/home/nabijaczleweli/.wine-32
diff --git a/upstream-default/home-nabijaczleweli-amix.mount b/zmgzmgzm-default/home-nabijaczleweli-amix.mount
index 444c819..bf2d37c 100644
--- a/upstream-default/home-nabijaczleweli-amix.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli-amix.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/amix
 What=babzoot/home/nabijaczleweli/amix
diff --git "a/upstream-default/home-nabijaczleweli-code-Rust\\x2dtarget.mount" "b/zmgzmgzm-default/home-nabijaczleweli-code-Rust\\x2dtarget.mount"
index 5a4e407..e4ef3bd 100644
--- "a/upstream-default/home-nabijaczleweli-code-Rust\\x2dtarget.mount"
+++ "b/zmgzmgzm-default/home-nabijaczleweli-code-Rust\\x2dtarget.mount"
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/code/Rust-target
 What=babzoot/home/nabijaczleweli/code/Rust-target
diff --git a/upstream-default/home-nabijaczleweli-code.mount b/zmgzmgzm-default/home-nabijaczleweli-code.mount
index 65b5efa..e872e78 100644
--- a/upstream-default/home-nabijaczleweli-code.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli-code.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/code
 What=babzoot/home/nabijaczleweli/code
diff --git a/upstream-default/home-nabijaczleweli-data.mount b/zmgzmgzm-default/home-nabijaczleweli-data.mount
index 1750a35..19f868f 100644
--- a/upstream-default/home-nabijaczleweli-data.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli-data.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/data
 What=babzoot/home/nabijaczleweli/data
diff --git a/upstream-default/home-nabijaczleweli-games.mount b/zmgzmgzm-default/home-nabijaczleweli-games.mount
index 6484f42..aac1b09 100644
--- a/upstream-default/home-nabijaczleweli-games.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli-games.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/games
 What=babzoot/home/nabijaczleweli/games
diff --git a/upstream-default/home-nabijaczleweli-music.mount b/zmgzmgzm-default/home-nabijaczleweli-music.mount
index baf5fb4..12b12be 100644
--- a/upstream-default/home-nabijaczleweli-music.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli-music.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/music
 What=babzoot/home/nabijaczleweli/music
diff --git "a/upstream-default/home-nabijaczleweli-pkg\\x2dapt.mount" "b/zmgzmgzm-default/home-nabijaczleweli-pkg\\x2dapt.mount"
index fadb72e..01b78d4 100644
--- "a/upstream-default/home-nabijaczleweli-pkg\\x2dapt.mount"
+++ "b/zmgzmgzm-default/home-nabijaczleweli-pkg\\x2dapt.mount"
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli/pkg-apt
 What=babzoot/home/nabijaczleweli/pkg-apt
diff --git a/upstream-default/home-nabijaczleweli.mount b/zmgzmgzm-default/home-nabijaczleweli.mount
index e4cae10..8a26e94 100644
--- a/upstream-default/home-nabijaczleweli.mount
+++ b/zmgzmgzm-default/home-nabijaczleweli.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home/nabijaczleweli
 What=babzoot/home/nabijaczleweli
diff --git a/upstream-default/home.mount b/zmgzmgzm-default/home.mount
index 91265e2..621d8d3 100644
--- a/upstream-default/home.mount
+++ b/zmgzmgzm-default/home.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/home
 What=babzoot/home
diff --git a/upstream-default/opt-icecc.mount b/zmgzmgzm-default/opt-icecc.mount
index 759ae68..780a4ac 100644
--- a/upstream-default/opt-icecc.mount
+++ b/zmgzmgzm-default/opt-icecc.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/opt/icecc
 What=babzoot/opt/icecc
diff --git a/upstream-default/opt-xorg.mount b/zmgzmgzm-default/opt-xorg.mount
index 2b5d785..a804470 100644
--- a/upstream-default/opt-xorg.mount
+++ b/zmgzmgzm-default/opt-xorg.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/opt/xorg
 What=babzoot/opt/xorg
diff --git a/upstream-default/opt.mount b/zmgzmgzm-default/opt.mount
index 7688c5f..81f67f6 100644
--- a/upstream-default/opt.mount
+++ b/zmgzmgzm-default/opt.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/opt
 What=babzoot/opt
diff --git a/upstream-default/root.mount b/zmgzmgzm-default/root.mount
index 085aa64..bcc8aa2 100644
--- a/upstream-default/root.mount
+++ b/zmgzmgzm-default/root.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/root
 What=babzoot/home/root
diff --git a/upstream-default/srv.mount b/zmgzmgzm-default/srv.mount
index d990126..f8481c5 100644
--- a/upstream-default/srv.mount
+++ b/zmgzmgzm-default/srv.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/srv
 What=babzoot/srv
diff --git a/upstream-default/usr-local.mount b/zmgzmgzm-default/usr-local.mount
index c6de459..b91db6b 100644
--- a/upstream-default/usr-local.mount
+++ b/zmgzmgzm-default/usr-local.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/usr/local
 What=babzoot/usr/local
diff --git a/upstream-default/var-cache.mount b/zmgzmgzm-default/var-cache.mount
index 421e1e9..a5a3682 100644
--- a/upstream-default/var-cache.mount
+++ b/zmgzmgzm-default/var-cache.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/var/cache
 What=babzoot/var/cache
diff --git a/upstream-default/var-log.mount b/zmgzmgzm-default/var-log.mount
index 833f105..70b3444 100644
--- a/upstream-default/var-log.mount
+++ b/zmgzmgzm-default/var-log.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/var/log
 What=babzoot/var/log
diff --git a/upstream-default/var-tmp.mount b/zmgzmgzm-default/var-tmp.mount
index 6718e6b..d33a4b7 100644
--- a/upstream-default/var-tmp.mount
+++ b/zmgzmgzm-default/var-tmp.mount
@@ -5,12 +5,10 @@ SourcePath=/etc/zfs/zfs-list.cache/babzoot
 Documentation=man:zfs-mount-generator(8)
 
 Before=zfs-mount.service local-fs.target
-After= zfs-load-key-babzoot.service
+After=zfs-load-key-babzoot.service
 Wants=
 BindsTo=zfs-load-key-babzoot.service
 
-
-
 [Mount]
 Where=/var/tmp
 What=babzoot/var/tmp
diff --git a/upstream-default/zfs-load-key-babzoot.service b/zmgzmgzm-default/zfs-load-key-babzoot.service
index 2716058..036f2bb 100644
--- a/upstream-default/zfs-load-key-babzoot.service
+++ b/zmgzmgzm-default/zfs-load-key-babzoot.service
@@ -8,8 +8,6 @@ DefaultDependencies=no
 Wants=
 After=
 
-
-
 [Service]
 Type=oneshot
 RemainAfterExit=yes
@@ -17,5 +15,5 @@ RemainAfterExit=yes
 # dataset is a parent of the root filesystem.
 StandardOutput=null
 StandardError=null
-ExecStart=/bin/sh -c 'set -eu;keystatus="$$(/sbin/zfs get -H -o value keystatus "babzoot")";[ "$$keystatus" = "unavailable" ] || exit 0;count=0;while [ $$count -lt 3 ];do  systemd-ask-password --id="zfs:babzoot"    "Enter passphrase for babzoot:"|    /sbin/zfs load-key "babzoot" && exit 0;  count=$$((count + 1));done;exit 1'
+ExecStart=/bin/sh -c '  set -eu;  keystatus="$$(/sbin/zfs get -H -o value keystatus "babzoot")";  [ "$$keystatus" = "unavailable" ] || exit 0;count=0;while [ $$count -lt 3 ]; do  systemd-ask-password --id="zfs:babzoot"    "Enter passphrase for babzoot:"|    /sbin/zfs load-key "babzoot" && exit 0;  count=$$((count + 1));done;exit 1'
 ExecStop=/bin/sh -c 'set -eu;keystatus="$$(/sbin/zfs get -H -o value keystatus "babzoot")";[ "$$keystatus" = "available" ] || exit 0;/sbin/zfs unload-key "babzoot"'

What follow are testing results from my incredibly sophisticated testing strategy (also here: zmg.tgz):

cd /tmp
tar -xaf zmg.tgz
cd zmg

cc -pthread  -Wall -Wextra -O3 -pipe   zmg.c -ozmg /lib/x86_64-linux-gnu/libzfs.so.4

rm -rf /tmp/testres
mkdir -p /tmp/testres/{upstream,zmgzmgzm}-{default,with-filling,_}

cp /lib/systemd/system-generators/zfs-mount-generator .
echo 'times' >> zfs-mount-generator

time PATH=/sbin:$PATH /tmp/zmg/./././././././././././zfs-mount-generator /tmp/testres/upstream-default /tmp/testres/upstream-default /tmp/testres/upstream-default
time ZFS_DEBUG=1      /tmp/zmg/./././././././././././././././././././zmg /tmp/testres/zmgzmgzm-default /tmp/testres/zmgzmgzm-default /tmp/testres/zmgzmgzm-default

sudo ln -s /tmp/zmg/filling /etc/zfs/zfs-list.cache

time PATH=/sbin:$PATH /tmp/zmg/./././././././././././zfs-mount-generator /tmp/testres/upstream-with-filling /tmp/testres/upstream-with-filling /tmp/testres/upstream-with-filling
time ZFS_DEBUG=1      /tmp/zmg/./././././././././././././././././././zmg /tmp/testres/zmgzmgzm-with-filling /tmp/testres/zmgzmgzm-with-filling /tmp/testres/zmgzmgzm-with-filling

time ZFS_DEBUG=2      /tmp/zmg/./././././././././././././././././././zmg /tmp/testres/zmgzmgzm-_ /tmp/testres/zmgzmgzm-_ /tmp/testres/zmgzmgzm-_

cp /proc/{cpu,mem}info /tmp/testres
# include the transcript up to now there too :)
tar -caf testres-$USER-$HOSTNAME.tgz /tmp/testres /etc/zfs/zfs-list.cache

sudo unlink /etc/zfs/zfs-list.cache/filling 

In short, real time as seen by time builtin:

Core 2 Duo E6400: 0.336s to 0.022s (15.27x)
i5-10210Y       : 0.202s to 0.006s (33.67x)
2 x Xeon E5645  : 0.402s to 0.015s (26.80x)
Xeon W-10885M   : 0.114s to 0.005s (22.80x)
Core 2 Duo E6400 (1x2x1, 2.13GHz) (2-channel DDR2-2133, 2.5/3.8G avail), 1 pool, sid x32 (or "my router")
real    0m0.002s
user    0m0.001s
sys     0m0.002s


real    0m0.005s
user    0m0.005s
sys     0m0.000s



0m0.000000s 0m0.000000s
0m0.220000s 0m0.110000s

real    0m0.336s
user    0m0.224s
sys     0m0.117s


zfs-mount-generator: self    : user=0.003557s, system=0.010671s, maxrss=3682304B
zfs-mount-generator: children: user=0.014941s, system=0.001546s, maxrss=1867776B
zfs-mount-generator: wall    : total=0.016961994s = init=0.002641825s + real=0.014320169s

real    0m0.022s
user    0m0.019s
sys     0m0.013s



zfs-mount-generator: forked 14733, canmount_on=0, dataset=filling/machine/1200-S121
zfs-mount-generator: forked 14734, canmount_on=1, dataset=filling/machine
zfs-mount-generator: forked 14735, canmount_on=1, dataset=filling/machine/szarotka/CDs
zfs-mount-generator: forked 14736, canmount_on=1, dataset=filling/machine/szarotka/floppies
zfs-mount-generator: forked 14737, canmount_on=0, dataset=filling/machine/szarotka
zfs-mount-generator: forked 14738, canmount_on=1, dataset=filling/mail/krysiaczek
zfs-mount-generator: forked 14739, canmount_on=0, dataset=filling/mail/misio
zfs-mount-generator: forked 14740, canmount_on=1, dataset=filling/mail/mist
zfs-mount-generator: forked 14741, canmount_on=0, dataset=filling/mail
zfs-mount-generator: forked 14742, canmount_on=1, dataset=filling/mail/nabijaczleweli
zfs-mount-generator: forked 14743, canmount_on=1, dataset=filling/mail/tymek
zfs-mount-generator: forked 14744, canmount_on=1, dataset=filling
zfs-mount-generator: forked 14745, canmount_on=1, dataset=filling/root
zfs-mount-generator: forked 14746, canmount_on=1, dataset=filling/share/dziadki
zfs-mount-generator: forked 14747, canmount_on=1, dataset=filling/share/krysiaczek
zfs-mount-generator: forked 14748, canmount_on=1, dataset=filling/share/misio
zfs-mount-generator: forked 14749, canmount_on=1, dataset=filling/share
zfs-mount-generator: forked 14750, canmount_on=1, dataset=filling/share/nabijaczleweli
zfs-mount-generator: forked 14751, canmount_on=1, dataset=filling/share/public
zfs-mount-generator: forked 14752, canmount_on=1, dataset=filling/share/torrent
zfs-mount-generator: forked 14753, canmount_on=1, dataset=filling/share/tymek
zfs-mount-generator: forked 14754, canmount_on=1, dataset=filling/store/krysiaczek
zfs-mount-generator: forked 14755, canmount_on=1, dataset=filling/store/misio/dset
zfs-mount-generator: forked 14756, canmount_on=1, dataset=filling/store/misio
zfs-mount-generator: forked 14757, canmount_on=1, dataset=filling/store
zfs-mount-generator: forked 14758, canmount_on=1, dataset=filling/store/nabijaczleweli/amix
zfs-mount-generator: forked 14759, canmount_on=1, dataset=filling/store/nabijaczleweli/Carambola2
zfs-mount-generator: forked 14760, canmount_on=1, dataset=filling/store/nabijaczleweli/debian.nabijaczleweli.xyz
zfs-mount-generator: forked 14761, canmount_on=1, dataset=filling/store/nabijaczleweli/foreign.nabijaczleweli.xyz
zfs-mount-generator: forked 14762, canmount_on=1, dataset=filling/store/nabijaczleweli/lfs.nabijaczleweli.xyz
zfs-mount-generator: forked 14763, canmount_on=1, dataset=filling/store/nabijaczleweli/linux
zfs-mount-generator: forked 14764, canmount_on=1, dataset=filling/store/nabijaczleweli
zfs-mount-generator: forked 14765, canmount_on=1, dataset=filling/store/nabijaczleweli/NetBSD
zfs-mount-generator: forked 14766, canmount_on=1, dataset=filling/store/nabijaczleweli/tftp-data
zfs-mount-generator: forked 14767, canmount_on=1, dataset=filling/store/dset
zfs-mount-generator: forked 14768, canmount_on=1, dataset=filling/store/tymek
zfs-mount-generator: 14733 done, user=0.000419s, system=0.000000s, maxrss=1572864B, ex=0
zfs-mount-generator: 14734 done, user=0.000631s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14735 done, user=0.000598s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14736 done, user=0.000521s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14738 done, user=0.000525s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14740 done, user=0.000483s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14742 done, user=0.000467s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14743 done, user=0.000490s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14744 done, user=0.000448s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14745 done, user=0.000449s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14746 done, user=0.000448s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14747 done, user=0.000472s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14748 done, user=0.000460s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14749 done, user=0.000460s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14750 done, user=0.000506s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14751 done, user=0.000000s, system=0.000555s, maxrss=1970176B, ex=0
zfs-mount-generator: 14752 done, user=0.000485s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14753 done, user=0.000000s, system=0.000614s, maxrss=1970176B, ex=0
zfs-mount-generator: 14754 done, user=0.000483s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14755 done, user=0.000478s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14756 done, user=0.000466s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14757 done, user=0.000417s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14758 done, user=0.000513s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14759 done, user=0.000470s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14760 done, user=0.000490s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14761 done, user=0.000484s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14762 done, user=0.000507s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14763 done, user=0.000561s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14764 done, user=0.000463s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14765 done, user=0.000460s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14766 done, user=0.000457s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14767 done, user=0.000000s, system=0.000467s, maxrss=1970176B, ex=0
zfs-mount-generator: 14768 done, user=0.000442s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14737 done, user=0.000487s, system=0.000000s, maxrss=1970176B, ex=0
zfs-mount-generator: 14741 done, user=0.000000s, system=0.000521s, maxrss=1970176B, ex=0
zfs-mount-generator: 14739 done, user=0.000464s, system=0.000000s, maxrss=1970176B, ex=0

zfs-mount-generator: self    : user=0.003642s, system=0.014571s, maxrss=3944448B
zfs-mount-generator: children: user=0.015516s, system=0.002158s, maxrss=1970176B
zfs-mount-generator: wall    : total=0.019604524s = init=0.003344847s + real=0.016259677s

real    0m0.025s
user    0m0.020s
sys     0m0.017s
i5-10210Y (1x4x2, 1GHz nominal, 4GHz turbo) (2-channel LPDDR3-2133, 13.8/15.5G avail), 1 pool, sid amd64 (or "my laptop")
0m0.000000s 0m0.000000s
0m0.140000s 0m0.050000s

real	0m0.202s
user	0m0.154s
sys	0m0.054s


zfs-mount-generator: self    : user=0.000000s, system=0.005685s, maxrss=3338240B
zfs-mount-generator: children: user=0.007312s, system=0.000206s, maxrss=1642496B
zfs-mount-generator: wall    : total=0.004085118s = init=0.000912860s + real=0.003172258s

real	0m0.006s
user	0m0.007s
sys	0m0.006s



0m0.000000s 0m0.000000s
0m0.230000s 0m0.080000s

real	0m0.317s
user	0m0.243s
sys	0m0.086s


zfs-mount-generator: self    : user=0.000000s, system=0.008898s, maxrss=3358720B
zfs-mount-generator: children: user=0.013731s, system=0.000835s, maxrss=1617920B
zfs-mount-generator: wall    : total=0.007633400s = init=0.000799658s + real=0.006833742s

real	0m0.010s
user	0m0.014s
sys	0m0.010s



zfs-mount-generator: forked 5933, canmount_on=0, dataset=filling/machine/1200-S121
zfs-mount-generator: forked 5934, canmount_on=1, dataset=filling/machine
zfs-mount-generator: forked 5935, canmount_on=1, dataset=filling/machine/szarotka/CDs
zfs-mount-generator: forked 5936, canmount_on=1, dataset=filling/machine/szarotka/floppies
zfs-mount-generator: forked 5937, canmount_on=0, dataset=filling/machine/szarotka
zfs-mount-generator: forked 5938, canmount_on=1, dataset=filling/mail/krysiaczek
zfs-mount-generator: forked 5939, canmount_on=0, dataset=filling/mail/misio
zfs-mount-generator: forked 5940, canmount_on=1, dataset=filling/mail/mist
zfs-mount-generator: forked 5941, canmount_on=0, dataset=filling/mail
zfs-mount-generator: forked 5942, canmount_on=1, dataset=filling/mail/nabijaczleweli
zfs-mount-generator: forked 5943, canmount_on=1, dataset=filling/mail/tymek
zfs-mount-generator: forked 5944, canmount_on=1, dataset=filling
zfs-mount-generator: forked 5945, canmount_on=1, dataset=filling/root
zfs-mount-generator: forked 5946, canmount_on=1, dataset=filling/share/dziadki
zfs-mount-generator: forked 5947, canmount_on=1, dataset=filling/share/krysiaczek
zfs-mount-generator: forked 5948, canmount_on=1, dataset=filling/share/misio
zfs-mount-generator: forked 5949, canmount_on=1, dataset=filling/share
zfs-mount-generator: forked 5950, canmount_on=1, dataset=filling/share/nabijaczleweli
zfs-mount-generator: forked 5951, canmount_on=1, dataset=filling/share/public
zfs-mount-generator: forked 5952, canmount_on=1, dataset=filling/share/torrent
zfs-mount-generator: forked 5953, canmount_on=1, dataset=filling/share/tymek
zfs-mount-generator: forked 5954, canmount_on=1, dataset=filling/store/krysiaczek
zfs-mount-generator: forked 5955, canmount_on=1, dataset=filling/store/misio/dset
zfs-mount-generator: forked 5956, canmount_on=1, dataset=filling/store/misio
zfs-mount-generator: forked 5957, canmount_on=1, dataset=filling/store
zfs-mount-generator: forked 5958, canmount_on=1, dataset=filling/store/nabijaczleweli/amix
zfs-mount-generator: forked 5959, canmount_on=1, dataset=filling/store/nabijaczleweli/Carambola2
zfs-mount-generator: forked 5960, canmount_on=1, dataset=filling/store/nabijaczleweli/debian.nabijaczleweli.xyz
zfs-mount-generator: forked 5961, canmount_on=1, dataset=filling/store/nabijaczleweli/foreign.nabijaczleweli.xyz
zfs-mount-generator: forked 5962, canmount_on=1, dataset=filling/store/nabijaczleweli/lfs.nabijaczleweli.xyz
zfs-mount-generator: forked 5963, canmount_on=1, dataset=filling/store/nabijaczleweli/linux
zfs-mount-generator: forked 5964, canmount_on=1, dataset=filling/store/nabijaczleweli
zfs-mount-generator: forked 5965, canmount_on=1, dataset=filling/store/nabijaczleweli/NetBSD
zfs-mount-generator: forked 5966, canmount_on=1, dataset=filling/store/nabijaczleweli/tftp-data
zfs-mount-generator: forked 5967, canmount_on=1, dataset=filling/store/dset
zfs-mount-generator: forked 5968, canmount_on=1, dataset=filling/store/tymek
zfs-mount-generator: forked 5969, canmount_on=0, dataset=babzoot
zfs-mount-generator: forked 5970, canmount_on=1, dataset=babzoot/boot
zfs-mount-generator: forked 5971, canmount_on=1, dataset=babzoot/home
zfs-mount-generator: forked 5972, canmount_on=1, dataset=babzoot/home/nabijaczleweli
zfs-mount-generator: forked 5973, canmount_on=1, dataset=babzoot/home/nabijaczleweli/.cargo
zfs-mount-generator: forked 5974, canmount_on=1, dataset=babzoot/home/nabijaczleweli/.wine
zfs-mount-generator: forked 5975, canmount_on=1, dataset=babzoot/home/nabijaczleweli/.wine-32
zfs-mount-generator: forked 5976, canmount_on=1, dataset=babzoot/home/nabijaczleweli/amix
zfs-mount-generator: forked 5977, canmount_on=1, dataset=babzoot/home/nabijaczleweli/code
zfs-mount-generator: forked 5978, canmount_on=1, dataset=babzoot/home/nabijaczleweli/code/Rust-target
zfs-mount-generator: forked 5979, canmount_on=1, dataset=babzoot/home/nabijaczleweli/data
zfs-mount-generator: forked 5980, canmount_on=1, dataset=babzoot/home/nabijaczleweli/games
zfs-mount-generator: forked 5981, canmount_on=1, dataset=babzoot/home/nabijaczleweli/music
zfs-mount-generator: forked 5982, canmount_on=1, dataset=babzoot/home/nabijaczleweli/pkg-apt
zfs-mount-generator: forked 5983, canmount_on=1, dataset=babzoot/home/root
zfs-mount-generator: forked 5984, canmount_on=1, dataset=babzoot/opt
zfs-mount-generator: forked 5985, canmount_on=1, dataset=babzoot/opt/icecc
zfs-mount-generator: forked 5986, canmount_on=1, dataset=babzoot/opt/xorg
zfs-mount-generator: forked 5987, canmount_on=1, dataset=babzoot/root
zfs-mount-generator: forked 5988, canmount_on=1, dataset=babzoot/srv
zfs-mount-generator: forked 5989, canmount_on=0, dataset=babzoot/usr
zfs-mount-generator: forked 5990, canmount_on=1, dataset=babzoot/usr/local
zfs-mount-generator: forked 5991, canmount_on=0, dataset=babzoot/var
zfs-mount-generator: forked 5992, canmount_on=1, dataset=babzoot/var/cache
zfs-mount-generator: forked 5993, canmount_on=0, dataset=babzoot/var/lib
zfs-mount-generator: forked 5994, canmount_on=1, dataset=babzoot/var/log
zfs-mount-generator: forked 5995, canmount_on=1, dataset=babzoot/var/tmp
zfs-mount-generator: 5933 done, user=0.000171s, system=0.000000s, maxrss=1380352B, ex=0
zfs-mount-generator: 5934 done, user=0.000282s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5935 done, user=0.000226s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5936 done, user=0.000261s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5938 done, user=0.000261s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5940 done, user=0.000224s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5942 done, user=0.000207s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5943 done, user=0.000263s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5944 done, user=0.000205s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5945 done, user=0.000227s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5946 done, user=0.000252s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5947 done, user=0.000218s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5948 done, user=0.000227s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5949 done, user=0.000213s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5950 done, user=0.000213s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5951 done, user=0.000218s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5952 done, user=0.000202s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5953 done, user=0.000213s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5954 done, user=0.000288s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5955 done, user=0.000250s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5956 done, user=0.000211s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5957 done, user=0.000209s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5958 done, user=0.000250s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5959 done, user=0.000216s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5960 done, user=0.000000s, system=0.000219s, maxrss=1548288B, ex=0
zfs-mount-generator: 5961 done, user=0.000000s, system=0.000235s, maxrss=1548288B, ex=0
zfs-mount-generator: 5962 done, user=0.000223s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5963 done, user=0.000204s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5964 done, user=0.000270s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5965 done, user=0.000201s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5966 done, user=0.000216s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5967 done, user=0.000195s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5968 done, user=0.000216s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5969 done, user=0.000204s, system=0.000000s, maxrss=1593344B, ex=0
zfs-mount-generator: 5970 done, user=0.000207s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5971 done, user=0.000190s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5972 done, user=0.000219s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5973 done, user=0.000200s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5974 done, user=0.000215s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5975 done, user=0.000196s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5976 done, user=0.000207s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5977 done, user=0.000194s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5978 done, user=0.000205s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5979 done, user=0.000188s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5980 done, user=0.000205s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5981 done, user=0.000186s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5982 done, user=0.000223s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5983 done, user=0.000195s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5984 done, user=0.000207s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5985 done, user=0.000191s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5986 done, user=0.000228s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5987 done, user=0.000195s, system=0.000000s, maxrss=1531904B, ex=0
zfs-mount-generator: 5988 done, user=0.000192s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5989 done, user=0.000156s, system=0.000000s, maxrss=1380352B, ex=0
zfs-mount-generator: 5990 done, user=0.000214s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5991 done, user=0.000144s, system=0.000000s, maxrss=1380352B, ex=0
zfs-mount-generator: 5992 done, user=0.000198s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5993 done, user=0.000143s, system=0.000000s, maxrss=1380352B, ex=0
zfs-mount-generator: 5994 done, user=0.000227s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5995 done, user=0.000234s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5937 done, user=0.000261s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5941 done, user=0.000267s, system=0.000000s, maxrss=1548288B, ex=0
zfs-mount-generator: 5939 done, user=0.000332s, system=0.000000s, maxrss=1544192B, ex=0

zfs-mount-generator: self    : user=0.007106s, system=0.003553s, maxrss=3321856B
zfs-mount-generator: children: user=0.013289s, system=0.000455s, maxrss=1593344B
zfs-mount-generator: wall    : total=0.008869662s = init=0.001079918s + real=0.007789744s

real	0m0.011s
user	0m0.021s
sys	0m0.004s
2 x Xeon E5645 (2x6x2, 2.4GHz nominal, 2.67GHz turbo) (both 3-channel DDR3-1333, 14.6/94.4G avail), 1 pool, buster amd64 (or "a long compute from my attic")
real    0m0.003s
user    0m0.000s
sys     0m0.003s


zfs-mount-generator: self    : user=0.003704s, system=0.003704s, maxrss=3952640B
zfs-mount-generator: children: user=0.000000s, system=0.000000s, maxrss=0B
zfs-mount-generator: wall    : total=0.002998227s = init=0.002983673s + real=0.000014554s

real    0m0.008s
user    0m0.004s
sys     0m0.004s



0m0.000000s 0m0.000000s
0m0.280000s 0m0.110000s

real    0m0.402s
user    0m0.291s
sys     0m0.119s


zfs-mount-generator: self    : user=0.004493s, system=0.008986s, maxrss=4128768B
zfs-mount-generator: children: user=0.017386s, system=0.000532s, maxrss=1871872B
zfs-mount-generator: wall    : total=0.010401915s = init=0.002974473s + real=0.007427442s

real    0m0.015s
user    0m0.022s
sys     0m0.010s




zfs-mount-generator: forked 9125, canmount_on=0, dataset=filling/machine/1200-S121
zfs-mount-generator: forked 9126, canmount_on=1, dataset=filling/machine
zfs-mount-generator: forked 9127, canmount_on=1, dataset=filling/machine/szarotka/CDs
zfs-mount-generator: forked 9128, canmount_on=1, dataset=filling/machine/szarotka/floppies
zfs-mount-generator: forked 9129, canmount_on=0, dataset=filling/machine/szarotka
zfs-mount-generator: forked 9130, canmount_on=1, dataset=filling/mail/krysiaczek
zfs-mount-generator: forked 9131, canmount_on=0, dataset=filling/mail/misio
zfs-mount-generator: forked 9132, canmount_on=1, dataset=filling/mail/mist
zfs-mount-generator: forked 9133, canmount_on=0, dataset=filling/mail
zfs-mount-generator: forked 9134, canmount_on=1, dataset=filling/mail/nabijaczleweli
zfs-mount-generator: forked 9135, canmount_on=1, dataset=filling/mail/tymek
zfs-mount-generator: forked 9136, canmount_on=1, dataset=filling
zfs-mount-generator: forked 9137, canmount_on=1, dataset=filling/root
zfs-mount-generator: forked 9138, canmount_on=1, dataset=filling/share/dziadki
zfs-mount-generator: forked 9139, canmount_on=1, dataset=filling/share/krysiaczek
zfs-mount-generator: forked 9140, canmount_on=1, dataset=filling/share/misio
zfs-mount-generator: forked 9141, canmount_on=1, dataset=filling/share
zfs-mount-generator: forked 9142, canmount_on=1, dataset=filling/share/nabijaczleweli
zfs-mount-generator: forked 9143, canmount_on=1, dataset=filling/share/public
zfs-mount-generator: forked 9144, canmount_on=1, dataset=filling/share/torrent
zfs-mount-generator: forked 9145, canmount_on=1, dataset=filling/share/tymek
zfs-mount-generator: forked 9146, canmount_on=1, dataset=filling/store/krysiaczek
zfs-mount-generator: forked 9147, canmount_on=1, dataset=filling/store/misio/dset
zfs-mount-generator: forked 9148, canmount_on=1, dataset=filling/store/misio
zfs-mount-generator: forked 9149, canmount_on=1, dataset=filling/store
zfs-mount-generator: forked 9150, canmount_on=1, dataset=filling/store/nabijaczleweli/amix
zfs-mount-generator: forked 9151, canmount_on=1, dataset=filling/store/nabijaczleweli/Carambola2
zfs-mount-generator: forked 9152, canmount_on=1, dataset=filling/store/nabijaczleweli/debian.nabijaczleweli.xyz
zfs-mount-generator: forked 9153, canmount_on=1, dataset=filling/store/nabijaczleweli/foreign.nabijaczleweli.xyz
zfs-mount-generator: forked 9154, canmount_on=1, dataset=filling/store/nabijaczleweli/lfs.nabijaczleweli.xyz
zfs-mount-generator: forked 9155, canmount_on=1, dataset=filling/store/nabijaczleweli/linux
zfs-mount-generator: forked 9156, canmount_on=1, dataset=filling/store/nabijaczleweli
zfs-mount-generator: forked 9157, canmount_on=1, dataset=filling/store/nabijaczleweli/NetBSD
zfs-mount-generator: forked 9158, canmount_on=1, dataset=filling/store/nabijaczleweli/tftp-data
zfs-mount-generator: forked 9159, canmount_on=1, dataset=filling/store/dset
zfs-mount-generator: forked 9160, canmount_on=1, dataset=filling/store/tymek
zfs-mount-generator: 9125 done, user=0.000303s, system=0.000000s, maxrss=1671168B, ex=0
zfs-mount-generator: 9126 done, user=0.000586s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9127 done, user=0.000490s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9128 done, user=0.000450s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9130 done, user=0.000543s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9132 done, user=0.000445s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9134 done, user=0.000597s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9135 done, user=0.000539s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9136 done, user=0.000520s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9137 done, user=0.000555s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9138 done, user=0.000478s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9139 done, user=0.000000s, system=0.000472s, maxrss=2002944B, ex=0
zfs-mount-generator: 9140 done, user=0.000555s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9141 done, user=0.000546s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9142 done, user=0.000511s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9143 done, user=0.000521s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9144 done, user=0.000517s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9145 done, user=0.000607s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9146 done, user=0.000536s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9147 done, user=0.000519s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9148 done, user=0.000592s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9149 done, user=0.000522s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9150 done, user=0.000517s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9151 done, user=0.000590s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9152 done, user=0.000493s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9153 done, user=0.000476s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9154 done, user=0.000554s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9155 done, user=0.000000s, system=0.000485s, maxrss=2002944B, ex=0
zfs-mount-generator: 9156 done, user=0.000000s, system=0.000427s, maxrss=2002944B, ex=0
zfs-mount-generator: 9157 done, user=0.000606s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9158 done, user=0.000439s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9159 done, user=0.000389s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9160 done, user=0.000498s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9129 done, user=0.000514s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9131 done, user=0.000521s, system=0.000000s, maxrss=2002944B, ex=0
zfs-mount-generator: 9133 done, user=0.000505s, system=0.000000s, maxrss=2002944B, ex=0

zfs-mount-generator: self    : user=0.008280s, system=0.008280s, maxrss=4415488B
zfs-mount-generator: children: user=0.017052s, system=0.001385s, maxrss=2002944B
zfs-mount-generator: wall    : total=0.012633730s = init=0.002975813s + real=0.009657917s

real    0m0.018s
user    0m0.026s
sys     0m0.011s
Xeon W-10885M (1x8x2, 2.4GHz nominal, 5.3GHz turbo) (2-channel DDR4-2933, 78.1/125.4G avail), 1 pool, sid amd64 (or "my mate's P15")
0m0.000000s 0m0.000000s
0m0.070000s 0m0.040000s
PATH=/sbin:$PATH /tmp/zmg/./././././././././././zfs-mount-generator     0.07s user 0.04s system 101% cpu 0.114 total


zfs-mount-generator: self    : user=0.000947s, system=0.003788s, maxrss=5390336B
zfs-mount-generator: children: user=0.003870s, system=0.000859s, maxrss=1687552B
zfs-mount-generator: wall    : total=0.003337850s = init=0.000965841s + real=0.002372009s
ZFS_DEBUG=1 /tmp/zmg/./././././././././././././././././././zmg     0.00s user 0.00s system 185% cpu 0.005 total



0m0.000000s 0m0.000000s
0m0.150000s 0m0.090000s
PATH=/sbin:$PATH /tmp/zmg/./././././././././././zfs-mount-generator     0.16s user 0.10s system 101% cpu 0.250 total


zfs-mount-generator: self    : user=0.001130s, system=0.006780s, maxrss=5402624B
zfs-mount-generator: children: user=0.008631s, system=0.002216s, maxrss=1724416B
zfs-mount-generator: wall    : total=0.006595143s = init=0.000980286s + real=0.005614857s
ZFS_DEBUG=1 /tmp/zmg/./././././././././././././././././././zmg     0.01s user 0.01s system 223% cpu 0.008 total



zfs-mount-generator: forked 833472, canmount_on=0, dataset=filling/machine/1200-S121
zfs-mount-generator: forked 833473, canmount_on=1, dataset=filling/machine
zfs-mount-generator: forked 833474, canmount_on=1, dataset=filling/machine/szarotka/CDs
zfs-mount-generator: forked 833475, canmount_on=1, dataset=filling/machine/szarotka/floppies
zfs-mount-generator: forked 833476, canmount_on=0, dataset=filling/machine/szarotka
zfs-mount-generator: forked 833478, canmount_on=1, dataset=filling/mail/krysiaczek
zfs-mount-generator: forked 833479, canmount_on=0, dataset=filling/mail/misio
zfs-mount-generator: forked 833480, canmount_on=1, dataset=filling/mail/mist
zfs-mount-generator: forked 833481, canmount_on=0, dataset=filling/mail
zfs-mount-generator: forked 833482, canmount_on=1, dataset=filling/mail/nabijaczleweli
zfs-mount-generator: forked 833483, canmount_on=1, dataset=filling/mail/tymek
zfs-mount-generator: forked 833484, canmount_on=1, dataset=filling
zfs-mount-generator: forked 833485, canmount_on=1, dataset=filling/root
zfs-mount-generator: forked 833486, canmount_on=1, dataset=filling/share/dziadki
zfs-mount-generator: forked 833487, canmount_on=1, dataset=filling/share/krysiaczek
zfs-mount-generator: forked 833488, canmount_on=1, dataset=filling/share/misio
zfs-mount-generator: forked 833489, canmount_on=1, dataset=filling/share
zfs-mount-generator: forked 833491, canmount_on=1, dataset=filling/share/nabijaczleweli
zfs-mount-generator: forked 833492, canmount_on=1, dataset=filling/share/public
zfs-mount-generator: forked 833493, canmount_on=1, dataset=filling/share/torrent
zfs-mount-generator: forked 833494, canmount_on=1, dataset=filling/share/tymek
zfs-mount-generator: forked 833495, canmount_on=1, dataset=filling/store/krysiaczek
zfs-mount-generator: forked 833496, canmount_on=1, dataset=filling/store/misio/dset
zfs-mount-generator: forked 833497, canmount_on=1, dataset=filling/store/misio
zfs-mount-generator: forked 833498, canmount_on=1, dataset=filling/store
zfs-mount-generator: forked 833499, canmount_on=1, dataset=filling/store/nabijaczleweli/amix
zfs-mount-generator: forked 833500, canmount_on=1, dataset=filling/store/nabijaczleweli/Carambola2
zfs-mount-generator: forked 833501, canmount_on=1, dataset=filling/store/nabijaczleweli/debian.nabijaczleweli.xyz
zfs-mount-generator: forked 833502, canmount_on=1, dataset=filling/store/nabijaczleweli/foreign.nabijaczleweli.xyz
zfs-mount-generator: forked 833503, canmount_on=1, dataset=filling/store/nabijaczleweli/lfs.nabijaczleweli.xyz
zfs-mount-generator: forked 833504, canmount_on=1, dataset=filling/store/nabijaczleweli/linux
zfs-mount-generator: forked 833505, canmount_on=1, dataset=filling/store/nabijaczleweli
zfs-mount-generator: forked 833506, canmount_on=1, dataset=filling/store/nabijaczleweli/NetBSD
zfs-mount-generator: forked 833507, canmount_on=1, dataset=filling/store/nabijaczleweli/tftp-data
zfs-mount-generator: forked 833508, canmount_on=1, dataset=filling/store/dset
zfs-mount-generator: forked 833509, canmount_on=1, dataset=filling/store/tymek
zfs-mount-generator: forked 833510, canmount_on=0, dataset=zonama
zfs-mount-generator: forked 833511, canmount_on=1, dataset=zonama/boot
zfs-mount-generator: forked 833512, canmount_on=1, dataset=zonama/home
zfs-mount-generator: forked 833513, canmount_on=1, dataset=zonama/home/griwes
zfs-mount-generator: forked 833514, canmount_on=1, dataset=zonama/home/root
zfs-mount-generator: forked 833515, canmount_on=1, dataset=zonama/opt
zfs-mount-generator: forked 833516, canmount_on=1, dataset=zonama/root
zfs-mount-generator: forked 833518, canmount_on=1, dataset=zonama/root/3d5c8a8c6ffe4906ed9debdcdbac3ad2364c7caa61e34c8a917f18b3362e4361
zfs-mount-generator: forked 833520, canmount_on=1, dataset=zonama/root/7d8c60521551fb0556f072ba32eedd5ac846cc915fb216e0e61ccc3dfafc4ee6
zfs-mount-generator: forked 833521, canmount_on=1, dataset=zonama/root/7d8c60521551fb0556f072ba32eedd5ac846cc915fb216e0e61ccc3dfafc4ee6-init
zfs-mount-generator: forked 833522, canmount_on=1, dataset=zonama/root/80c97ba257c5f79e91f198a31e87990fdfd72a034c898b9e14c3be780ef952b5
zfs-mount-generator: forked 833523, canmount_on=1, dataset=zonama/root/8c7ccf0ed4dd79df6c7f9d77890349dabb224ee4874a4066a955c93e628a8b99
zfs-mount-generator: forked 833524, canmount_on=1, dataset=zonama/root/99a0a9626343fc0c75163509a8115ecdc2c1733d7813a36dd59f007898f49e92
zfs-mount-generator: forked 833525, canmount_on=1, dataset=zonama/root/99a0a9626343fc0c75163509a8115ecdc2c1733d7813a36dd59f007898f49e92-init
zfs-mount-generator: forked 833526, canmount_on=1, dataset=zonama/root/a9e34564bb91870b23f546c2deb21fa143f848263d3f3ca7e629f15a781f8edf
zfs-mount-generator: forked 833527, canmount_on=1, dataset=zonama/root/b8bcccaa6029de3b13d17f98061ab5b3dd03b6ed479287cfe5ed7de43f92f77c
zfs-mount-generator: forked 833528, canmount_on=1, dataset=zonama/root/da4642cd1c539e754a079feef3b61a51c9eae3b8d48e585c01d03333c4592c0a
zfs-mount-generator: forked 833529, canmount_on=1, dataset=zonama/srv
zfs-mount-generator: forked 833530, canmount_on=0, dataset=zonama/usr
zfs-mount-generator: forked 833531, canmount_on=1, dataset=zonama/usr/local
zfs-mount-generator: forked 833532, canmount_on=0, dataset=zonama/var
zfs-mount-generator: forked 833533, canmount_on=1, dataset=zonama/var/cache
zfs-mount-generator: forked 833534, canmount_on=0, dataset=zonama/var/lib
zfs-mount-generator: forked 833535, canmount_on=1, dataset=zonama/var/log
zfs-mount-generator: forked 833536, canmount_on=1, dataset=zonama/var/tmp
zfs-mount-generator: 833472 done, user=0.000124s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833473 done, user=0.000192s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833474 done, user=0.000196s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833475 done, user=0.000246s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833478 done, user=0.000185s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833480 done, user=0.000000s, system=0.000184s, maxrss=1667072B, ex=0
zfs-mount-generator: 833482 done, user=0.000177s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833483 done, user=0.000226s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833484 done, user=0.000191s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833485 done, user=0.000181s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833486 done, user=0.000215s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833487 done, user=0.000168s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833488 done, user=0.000176s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833489 done, user=0.000171s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833491 done, user=0.000000s, system=0.000211s, maxrss=1667072B, ex=0
zfs-mount-generator: 833492 done, user=0.000181s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833493 done, user=0.000175s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833494 done, user=0.000174s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833495 done, user=0.000164s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833496 done, user=0.000201s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833497 done, user=0.000183s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833498 done, user=0.000175s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833499 done, user=0.000175s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833500 done, user=0.000176s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833501 done, user=0.000000s, system=0.000181s, maxrss=1667072B, ex=0
zfs-mount-generator: 833502 done, user=0.000200s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833503 done, user=0.000191s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833504 done, user=0.000182s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833505 done, user=0.000185s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833506 done, user=0.000204s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833507 done, user=0.000182s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833508 done, user=0.000187s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833509 done, user=0.000169s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833510 done, user=0.000000s, system=0.000196s, maxrss=1712128B, ex=0
zfs-mount-generator: 833511 done, user=0.000000s, system=0.000190s, maxrss=1667072B, ex=0
zfs-mount-generator: 833512 done, user=0.000181s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833513 done, user=0.000183s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833514 done, user=0.000184s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833515 done, user=0.000183s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833516 done, user=0.000179s, system=0.000000s, maxrss=1650688B, ex=0
zfs-mount-generator: 833518 done, user=0.000143s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833520 done, user=0.000136s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833521 done, user=0.000138s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833522 done, user=0.000128s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833523 done, user=0.000000s, system=0.000125s, maxrss=1433600B, ex=0
zfs-mount-generator: 833524 done, user=0.000000s, system=0.000126s, maxrss=1433600B, ex=0
zfs-mount-generator: 833525 done, user=0.000129s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833526 done, user=0.000121s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833527 done, user=0.000120s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833528 done, user=0.000138s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833529 done, user=0.000176s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833530 done, user=0.000150s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833531 done, user=0.000184s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833532 done, user=0.000133s, system=0.000000s, maxrss=1433600B, ex=0
zfs-mount-generator: 833533 done, user=0.000181s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833534 done, user=0.000000s, system=0.000168s, maxrss=1433600B, ex=0
zfs-mount-generator: 833535 done, user=0.000000s, system=0.000169s, maxrss=1667072B, ex=0
zfs-mount-generator: 833536 done, user=0.000174s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833481 done, user=0.000000s, system=0.000202s, maxrss=1667072B, ex=0
zfs-mount-generator: 833476 done, user=0.000232s, system=0.000000s, maxrss=1667072B, ex=0
zfs-mount-generator: 833479 done, user=0.000212s, system=0.000000s, maxrss=1667072B, ex=0

zfs-mount-generator: self    : user=0.000976s, system=0.007812s, maxrss=5402624B
zfs-mount-generator: children: user=0.008983s, system=0.001758s, maxrss=1712128B
zfs-mount-generator: wall    : total=0.007386884s = init=0.000998981s + real=0.006387903s
ZFS_DEBUG=2 /tmp/zmg/./././././././././././././././././././zmg     0.01s user 0.01s system 212% cpu 0.009 total

How Has This Been Tested?

Ran it more times than I can think.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the OpenZFS code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes. – hopefully none should break!
  • I have run the ZFS Test Suite with this change applied. – CI take my hand
  • All commit messages are properly formatted and contain Signed-off-by.

@nabijaczleweli

This comment has been minimized.

@nabijaczleweli

This comment has been minimized.

@nabijaczleweli nabijaczleweli force-pushed the zomg branch 9 times, most recently from b80c6c0 to 1791d06 Compare April 20, 2021 16:11
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Apr 20, 2021
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool. But before moving forward with this any more I'd like to get @aerusso, @rlaager, and @InsanePrawn's thoughts on this since they're most familiar with the generator. In principle I'm not against rewriting it in C, but we should make sure the performance wins are worth the added complexity. Do you know where the main bottleneck was in the shell script, could we perhaps have gotten close to the same performance with more modest changes to the script instead?

@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented Apr 20, 2021

Dunno, and I don't really care – it's a shell script that does five hundred lines of string manipulation for every single dataset and also is broken. I specifically wrote it to generate identical units (save for whitespace) in the first commit to be trivial to verify.

You could, I guess, properly sort all the cache files instead to fix it.
To get it to perform, uhhh, conjure up a writeable filesystem from somewhere, spawn a subshell for every line, move noauto_files handling to a file on that new filesystem, somehow manage to lock across those subshells, maybe? But then you also need a global fence for all of them (the noauto_not_on_sem equivalent), which..? And guarantee atomicity on that file (or, well, since the state is not just the file but also some bits of the output, you need the equivalent of noauto_names_sem to guard access to that section somehow). I mean, you could probably write it in shell if you really wanted, and, by god, it may even be take less than twice the time by the time you're done with it.

This finishes in the equivalent time of spawning a moderately-dynamically-linked executable (such as the new resulting C program, or literally anything you run from the shell, like zpool, or (to a lesser degree) sort) like twice or twice-and-a-half, and actually does more work than it sleeps (as evidenced by the 185-223% usage from the zsh time builtin, as compared to the 101%ish from the current shell implementation over literally more than twenty times more time).

@nabijaczleweli nabijaczleweli force-pushed the zomg branch 2 times, most recently from 89dc910 to c6ecc85 Compare April 20, 2021 22:33
@InsanePrawn
Copy link
Contributor

Well, the shell implementation is what I like to call 'historically grown' :)
I think rewriting the shellscript with a better-suited language has been proposed multiple times; I think we actually agreed that the last big extension I made was about as far as we wanted to stretch what's feasible in shell, but I just about got it to work in shell, so we stuck with it for the time being.
IIRC there seemed to be some consensus that something better in another language should be produced long-term, but I don't speak for others.

It might be worth revisiting what the generator outputs and whether we can handle some situations better or at all now, e.g. the noauto_files thing was obviously not the cleanest solution to the problem.

[I think we could strictly speaking solve the multiple pools bug in the shell version by cating the pool cache files together before looping over the lines :P]

@aerusso
Copy link
Contributor

aerusso commented Apr 21, 2021

Yeah, the shell script had really gotten uncomfortable to maintain last year. That said, given how infrequently this is run, I don't think performance improvement (while quite impressive) is really all that important. The improvement in readability and stronger language constructs available, though, make this very welcome.

As an aside, the real performance drain on the system is the history_event-zfs-list-cacher.sh zedlet, which is horrifically slow, and run dozens to hundreds of times every fifteen minutes on my machine (once for each snapshot taken). This causes missed zed events, and I seem to recall complaints about hangs on some people's computers. It's really really bad, and there's some really low hanging performance optimizations to be had there, e.g., only updating the changed dataset, which would bring down the scaling with number of datasets from (roughly) quadratic to linear. (There's also work on making zfs list faster, which will also be helpful.)

I doubt I'll be able to give a full, proper review, but I'll mention the one thing I noticed poking around a tiny bit: do_escape in systemd src/basic/unit-names.c has a special-case treatment of the first character in a path. In particular, it escapes a leading .. I don't superficially see that check done in systemd_escape here. It really is unfortunate that we have to re-implement the systemd-escape logic, and then track another project's changes to it! As distasteful as it may feel, it might make sense to call that executable instead of re-implementing the logic (which accounts for ~15% of the code!).

@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented Apr 21, 2021

@InsanePrawn I don't actually mind the noauto_files thing, and haven't come up with a better solution that does what it does, but that doesn't say much.
I did some minor hopefully-not-controversial clean-up in the generated units in the second patch and beyond.

And yeah, effectively catting it is what I meant by sorting all cache files, but sort "$FSLIST"/* | is one fewer process than cat "$FSLIST"/* | sort | :P

@aerusso This is run on every daemon reload, including the multiple that happen during boot, it's incredibly important. To my use-cases, at least.

zfs-list-cacher doesn't act on snapshots (at least, that's how it's written, and, testing it, that condition's correct):

# If we are acting on a snapshot, we have nothing to do
printf '%s' "${ZEVENT_HISTORY_DSNAME}" | grep '@' && exit 0

it also does a lot of other filtering to avoid spurious updates. Beside being written in a generally less-than-super-performant style and overly-wide locking, which is easy enough to fix separately, there isn't much wrong there.

You will also note that it does only touch the cache file for the affected pool (and anything less is impossible (or, at the very least, slower than just doing that)).

And you'll be happy to hear it no longer serially starts every zedlet with a second at 100% CPU in the pre-exec now (though it seems that that's only in 2.1.0-rc3 and on HEAD, so).

A pool name must begin with a letter and mountpoints are (verified to be) absolute paths. I don't see the problem, and don't intend to ship dead code. And I definitely don't intend to spawn processes to replace fifty lines of code that will never change again.

@nabijaczleweli nabijaczleweli force-pushed the zomg branch 4 times, most recently from 435897e to afb93d8 Compare April 21, 2021 10:50
@aerusso

This comment has been minimized.

@nabijaczleweli

This comment has been minimized.

@brokenthings22

This comment has been minimized.

@nabijaczleweli

This comment has been minimized.

@nabijaczleweli nabijaczleweli force-pushed the zomg branch 2 times, most recently from 848cf08 to ba4ac31 Compare May 5, 2021 16:32
@behlendorf
Copy link
Contributor

I'd like to go ahead and move forward with integrating this change in the next week or two. If folks can make time to test it in their environments that would helpful to ensure we don't accidentally introduce any regressions.

@nabijaczleweli nabijaczleweli force-pushed the zomg branch 2 times, most recently from b296a59 to f91081f Compare May 8, 2021 10:08
@nabijaczleweli
Copy link
Contributor Author

Bump! It's been two weeks and no one has raised an issue in this comment period, and I'd like to move forward with another round of optimisations and http[s]:// handling I've staged.

Copy link
Member

@rlaager rlaager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Change ABORT_ENOMEM to EXIT_ENOMEM. "abort" has a specific meaning in Unix C. The macro calls _exit() not abort(). I agree with it calling _exit(), so let's change the name to match.
  2. Change the comments from // to /* ... */. From a quick grep, literally 98-99% (depending on the pattern used) of the comments in the ZFS tree are /* ... */ form. That should be 100%, as ZFS follows the SunOS coding style which only uses /* ... */ comments.
  3. The $1, $2, etc. for the various fields seems like a vestige of the shell history of this generator. $1 is shell, not C. Nowhere in the C code are they referred to using offsets. The history cacher script does not refer to them with offsets, so it's not to match that. I see no reason for these to exist.

A plain rewrite of the shell version, and generates identical
units, save for replacing some empty lines with nothing, having fewer
meaningless spaces in After=s and different spacing in the lock scripts,
for a clean git diff -w

This is a gain of anywhere from 0m0.336s vs 0m0.022s (15.27x)
to 0m0.202s vs 0m0.006s (33.67x), depending on the hardware,
a.k.a. from "absolutely unusable" to "perfectly fine"

This also properly deals with canmount=noauto units across multiple
pools

See PR for detailed timings (of an early version) and diffs

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Ref: openzfs#11915
git-diff--w-dirty, but:
  * zfs-load-key-$DSET.service -> zfs-load-key@$DSET.service
  * flattened set -eu into other /bin/sh flags
  * simpler (for 1 2 3 vs while [ counter ]; counter+=1) prompt loop
  * exec $ZFS where applicable

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
@nabijaczleweli
Copy link
Contributor Author

sure, whatever. updated

Copy link
Member

@rlaager rlaager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels May 26, 2021
@behlendorf
Copy link
Contributor

Thanks for addressing the remaining feedback. I'll get this merged when the CI is done with it.

behlendorf pushed a commit that referenced this pull request May 27, 2021
git-diff--w-dirty, but:
  * zfs-load-key-$DSET.service -> zfs-load-key@$DSET.service
  * flattened set -eu into other /bin/sh flags
  * simpler (for 1 2 3 vs while [ counter ]; counter+=1) prompt loop
  * exec $ZFS where applicable

Reviewed-by: Antonio Russo <aerusso@aerusso.net>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #11915
Closes #11917
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
A plain rewrite of the shell version, and generates identical
units, save for replacing some empty lines with nothing, having fewer
meaningless spaces in After=s and different spacing in the lock scripts,
for a clean git diff -w

This is a gain of anywhere from 0m0.336s vs 0m0.022s (15.27x)
to 0m0.202s vs 0m0.006s (33.67x), depending on the hardware,
a.k.a. from "absolutely unusable" to "perfectly fine"

This also properly deals with canmount=noauto units across multiple
pools

See PR for detailed timings (of an early version) and diffs

Reviewed-by: Antonio Russo <aerusso@aerusso.net>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue openzfs#11915
Closes openzfs#11917
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
A plain rewrite of the shell version, and generates identical
units, save for replacing some empty lines with nothing, having fewer
meaningless spaces in After=s and different spacing in the lock scripts,
for a clean git diff -w

This is a gain of anywhere from 0m0.336s vs 0m0.022s (15.27x)
to 0m0.202s vs 0m0.006s (33.67x), depending on the hardware,
a.k.a. from "absolutely unusable" to "perfectly fine"

This also properly deals with canmount=noauto units across multiple
pools

See PR for detailed timings (of an early version) and diffs

Reviewed-by: Antonio Russo <aerusso@aerusso.net>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue openzfs#11915
Closes openzfs#11917
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
git-diff--w-dirty, but:
  * zfs-load-key-$DSET.service -> zfs-load-key@$DSET.service
  * flattened set -eu into other /bin/sh flags
  * simpler (for 1 2 3 vs while [ counter ]; counter+=1) prompt loop
  * exec $ZFS where applicable

Reviewed-by: Antonio Russo <aerusso@aerusso.net>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue openzfs#11915
Closes openzfs#11917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants