OpenZFS/src 5061f95include/sys spa.h, lib/libzpool kernel.c

Retire zfs_autoimport_disable kmod option

Back in 2014 the zfs_autoimport_disable module option was added to
control whether the kmods should load the pool configs from the cache
file on module load.  The default value since that time has been for
the kernel to not process the cache file.

Detecting and importing pools during boot is now controlled outside
of the kmod on both Linux and FreeBSD.  By all accounts this has been
working well and we can remove this dormant code on the kernel side.

The spa_config_load() function is has been moved to userspace, it is
now only used by libzpool.  Additionally, the spa_boot_init() hook
which was used by FreeBSD now looks to be used and was removed.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17618
DeltaFile
+10-105module/zfs/spa_config.c
+75-0lib/libzpool/kernel.c
+0-8module/zfs/spa_misc.c
+0-7module/os/freebsd/zfs/kmod_core.c
+0-4man/man4/zfs.4
+0-2include/sys/spa.h
+85-1266 files

OpenZFS/src d151432include/sys zil_impl.h zio.h, module/zfs zil.c zio.c

ZIL: Make allocations more flexible

When ZIL allocates space for new LWBs without knowing how much it
will require, it can use new metaslab_alloc_range() function to
allocate slightly more or less than it predicted.  It allows to
improve space efficiency by allocating bigger LWBs on RAIDZ/dRAID
instead of padding and possibly packing more ZIL records there.
It may also allow to reduce ganging in some cases by allowing to
allocate smaller LWBs when we are not sure we'll need bigger.

On the opposite side, when we allocate space for already closed
LWBs, when we precisely know how much space we need, we may just
allocate what we need instead of relying on writing less than
allocated, that does not work for RAIDZ.

Space for LWBs in open state (still being filled) is allocated
same as before.

Reviewed-by: Rob Norris <robn at despairlabs.com>

    [2 lines not shown]
DeltaFile
+143-81module/zfs/zil.c
+31-20module/zfs/zio.c
+4-3include/sys/zil_impl.h
+2-1include/sys/zio.h
+180-1054 files

OpenZFS/src 8d35a02. AUTHORS .mailmap

AUTHORS/mailmap: update with new contributors

Welcome to the house of fun! 🥳

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17634
DeltaFile
+13-0AUTHORS
+4-0.mailmap
+17-02 files

OpenZFS/src 28433c4module/zcommon simd_stat.c

simd_stat: expose availability of VAES and VPCLMULQDQ

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Joel Low <joel at joelsplace.sg>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Attila Fülöp <attila at fueloep.org>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17058
DeltaFile
+4-0module/zcommon/simd_stat.c
+4-01 files

OpenZFS/src 930f9cctests/zfs-tests/cmd crypto_test.c

crypto_test: include AVX2 GCM implementation in tests

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Joel Low <joel at joelsplace.sg>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Attila Fülöp <attila at fueloep.org>
Signed-off-by: Rob Norris <robn at despairlabs.com>
Closes #17058
DeltaFile
+2-0tests/zfs-tests/cmd/crypto_test.c
+2-01 files

OpenZFS/src bb9225econfig toolchain-simd.m4, contrib/icp/gcm-simd/boringssl aes-gcm-avx2-x86_64-linux.S LICENSE

Backport AVX2 AES-GCM implementation from BoringSSL

This uses the AVX2 versions of the AESENC and PCLMULQDQ instructions; on
Zen 3 this provides an up to 80% performance improvement.

Original source:
https://github.com/google/boringssl/blob/d5440dd2c2c500ac2d3bba4afec47a054b4d99ae/gen/bcm/aes-gcm-avx2-x86_64-linux.S

See the original BoringSSL commit at
https://github.com/google/boringssl/commit/3b6e1be4391d96e81cee022f77f7bab85d51cf4e.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Attila Fülöp <attila at fueloep.org>
Signed-off-by: Joel Low <joel at joelsplace.sg>
Closes #17058
DeltaFile
+1,328-0contrib/icp/gcm-simd/boringssl/aes-gcm-avx2-x86_64-linux.S
+1,323-0module/icp/asm-x86_64/modes/aesni-gcm-avx2-vaes.S
+293-78module/icp/algs/modes/gcm.c
+253-0module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.boringssl
+253-0contrib/icp/gcm-simd/boringssl/LICENSE
+44-0config/toolchain-simd.m4
+3,494-789 files not shown
+3,574-8215 files

OpenZFS/src 885d929module/zfs dsl_deadlist.c

Fix missed assertion update in physical rewrite patch

Physical rewrite patch changed the meaning of BP_GET_BIRTH(), but
I missed update one of its occurences, ending up asserting equal
logical birth times instead of equal physical birth times.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Fixes #17565
Closes #17631
DeltaFile
+2-1module/zfs/dsl_deadlist.c
+2-11 files

OpenZFS/src 3cfd670contrib/debian control

Add conflict/replacement with older SONAME libzfs and libzpool packages

In e8f0aa143e1b25d98624d4b2623a6e0fc42afb9e, the SONAMEs and package
names for libzfs and libzpool were bumped. The `contrib/debian/control`
file did not declare a conflict/replacement with the old package name.
This can cause dpkg to leave a system in an inconsistent state if the
old package is not manually uninstalled first.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Shengqi Chen <harry-chen at outlook.com>
Signed-off-by: Patrick Fasano <patrick at patrickfasano.com>
Closes #17586 
DeltaFile
+4-4contrib/debian/control
+4-41 files

OpenZFS/src a072611include/os/freebsd/spl/sys vm.h, module/os/freebsd/spl spl_vm.c

Revert "FreeBSD: zfs_putpages: don't undirty pages until after write completes"

This causes async putpages to leave the pages sbusied for a long time,
which hurts concurrency.  Revert for now until we have a better
approach.

This reverts commit 238eab7dc16932edbe9bcc990e8e5376bfe5b2ba.

Reported by:    Ihor Antonov <ngor at hugpoint.tech>
Discussed with: Rob Norris <rob.norris at klarasystems.com>

References: freebsd/freebsd-src at 738a9a7
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Reviewed-by: Mark Johnston <markj at FreeBSD.org>
Ported-by: Rob Norris <rob.norris at klarasystems.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17533
DeltaFile
+15-45module/os/freebsd/zfs/zfs_vnops_os.c
+0-1include/os/freebsd/spl/sys/vm.h
+0-1module/os/freebsd/spl/spl_vm.c
+15-473 files

OpenZFS/src 3b64a96include/os/freebsd/spl/sys vm.h, module/os/freebsd/spl spl_vm.c

FreeBSD: zfs_putpages: don't undirty pages until after write completes

In syncing mode, zfs_putpages() would put the entire range of pages onto
the ZIL, then return VM_PAGER_OK for each page to the kernel. However,
an associated zil_commit() or txg sync had not happened at this point,
so the write may not actually be on disk.

So, we rework that case to use a ZIL commit callback, and do the
post-write work of undirtying the page and signaling completion there.
We return VM_PAGER_PEND to the kernel instead so it knows that we will
take care of it.

The original version of this (238eab7dc1) copied the Linux model and did
the cleanup in a ZIL callback for both async and sync. This was a
mistake, as FreeBSD does not have a separate "busy for writeback" flag
like Linux which keeps the page usable. The full sbusy flag locks the
entire page out until the itx callback fires, which for async is after
txg sync, which could be literal seconds in the future.


    [12 lines not shown]
DeltaFile
+73-14module/os/freebsd/zfs/zfs_vnops_os.c
+1-0include/os/freebsd/spl/sys/vm.h
+1-0module/os/freebsd/spl/spl_vm.c
+75-143 files

OpenZFS/src 0fe1036module/zfs multilist.c

Allow vmem_alloc backed multilists

Systems with a large number of CPU cores (192+) may trigger the large
allocation warning in multilist_create() on Linux.  Silence the warning
by converting the allocation to vmem_alloc().

On Linux this results in a call to kvalloc() which will alloc vmem
for large allocations and kmem for small allocations.

On FreeBSD both vmem_alloc and kmem_alloc internally use the same
allocator so there is no functional change.

Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17616
DeltaFile
+2-2module/zfs/multilist.c
+2-21 files

OpenZFS/src 3e78905module/zstd zfs_zstd.c

Silence zstd large allocation warning

Allow zstd_mempool_init() to allocate using vmem_alloc() instead
of kmem_alloc() to silence the large allocation warning on Linux
during module load when the system has a large number of CPUs.

It's not at all clear to me that scaling the allocation size with
the number of CPUs is beneficial and that should be evaluated.
But for the moment this should resolve the warning without
introducing any unexpected side effects.

Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Rob Norris <robn at despairlabs.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17620
Closes #11557
DeltaFile
+4-4module/zstd/zfs_zstd.c
+4-41 files

OpenZFS/src 46de04d.github/workflows/scripts qemu-2-start.sh

FreeBSD 15.0 is now "PRERELEASE"

Chase URL change from the FreeBSD project.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Colin Percival <cperciva at tarsnap.com>
Closes #17617
DeltaFile
+1-1.github/workflows/scripts/qemu-2-start.sh
+1-11 files

OpenZFS/src 41ca229. META

Linux 6.16 compat: META

Update the META file to reflect compatibility with the 6.16
kernel.

Tested with 6.16.0-0-stable of Alpine Linux edge, see
<https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/87929>.

Reviewed-by: Rob Norris <robn at despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Achill Gilgenast <achill at achill.org>
Closes #17578
DeltaFile
+1-1META
+1-11 files

OpenZFS/src 9651668cmd/zed/zed.d zed-functions.sh

zed: prettify slack notification message

This converts the body of a ZED slack notification from
plain text to code block style to help with readability.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: René Wirnata <rene.wirnata at pandascience.net>
Closes #17610
DeltaFile
+2-1cmd/zed/zed.d/zed-functions.sh
+2-11 files

OpenZFS/src a49c957module/os/linux/zfs zvol_os.c

linux/zvol_os: fix crash with blk-mq on Linux 4.19

03987f71e3 (#16069) added a workaround to get the blk-mq hardware
context for older kernels that don't cache it in the struct request.
However, this workaround appears to be incomplete.

In 4.19, the rq data context is optional. If its not initialised, then
the cached rq->cpu will be -1, and so using it to index into mq_map
causes a crash.

Given that the upstream 4.19 is now in extended LTS and rarely seen,
RHEL8 4.18+ has long carried "modern" blk-mq support, and the cached
hardware context has been available since 5.1, I'm not going to huge
lengths to get queue selection correct for the very few people that are
likely to feel it. To that end, we simply call raw_smp_processor_id() to
get a valid CPU id and use that instead.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>

    [4 lines not shown]
DeltaFile
+2-2module/os/linux/zfs/zvol_os.c
+2-21 files

OpenZFS/src d1d7063rpm/generic zfs.spec.in

rpm: don't list /sbin/zgenhostid twice in %files

The location of zgenhostid was changed in 0ae733c7a (Install zgenhostid
to sbindir, 2021-01-21).  We include all files within sbindir two lines
earlier, which causes rpmbuild to report:

    File listed twice: /sbin/zgenhostid

Drop the redundant entry from the %files section.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Todd Zullinger <tmz at pobox.com>
Closes #17601
DeltaFile
+0-1rpm/generic/zfs.spec.in
+0-11 files

OpenZFS/src 11f8441config toolchain-simd.m4

config: Avoid `void main()` in toolchain-simd.m4

Be standard-compliant by using `int main()`.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Attila Fülöp <attila at fueloep.org>
Closes #13303
Closes #17590
DeltaFile
+46-23config/toolchain-simd.m4
+46-231 files

OpenZFS/src 57b614einclude/os/linux/kernel/linux simd_x86.h

SIMD: Don't require definition of `HAVE_XSAVE`

Currently we fail the compilation via the #error directive if
`HAVE_XSAVE` isn't defined. This breaks i586 builds since we check
the toolchains SIMD support only on i686 and onward.

Remove the requirement to fix the build on i586.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Attila Fülöp <attila at fueloep.org>
Closes #13303
Closes #17590
DeltaFile
+10-11include/os/linux/kernel/linux/simd_x86.h
+10-111 files

OpenZFS/src 0c7d6e2module/os/linux/zfs zfs_vnops_os.c

Linux: zfs_putpage: document (and fix!) confusing sync/commit modes

The structure of zfs_putpage() and its callers is tricky to follow.
There's a lot more we could do to improve it, but at least now we have
some description of one of the trickier bits.

Writing this exposed a very subtle bug: most async pages pushed out
through zpl_putpages() would go to the ZIL with commit=false, which can
yield a less-efficient write policy. So this commit updates that too.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17584
DeltaFile
+44-11module/os/linux/zfs/zfs_vnops_os.c
+44-111 files

OpenZFS/src b9c45femodule/os/linux/zfs zfs_vnops_os.c

Linux: zfs_putpage: complete async page writeback immediately

For async page writeback, we do not need to wait for the page to be on
disk before returning to the caller; it's enough that the data from the
dirty page be on the DMU and in the in-memory ZIL, just like any other
write.

So, if this is not a syncing write, don't add a callback to the itx, and
instead just unlock the page immediately.

(This is effectively the same concept used for FreeBSD in d323fbf49c).

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17584
Closes #14290
DeltaFile
+7-12module/os/linux/zfs/zfs_vnops_os.c
+7-121 files

OpenZFS/src f72226ainclude/os/linux/zfs/sys trace_acl.h, module/os/freebsd/zfs zfs_znode_os.c

Linux: sync: remove async/sync accounting

All this machinery is there to try to understand when there an async
writeback waiting to complete because the intent log callbacks are still
outstanding, and force them with a timely zil_commit(). The next commit
fixes this properly, so there's no need for all this extra housekeeping.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17584
DeltaFile
+0-41module/os/linux/zfs/zpl_file.c
+0-25module/os/linux/zfs/zfs_vnops_os.c
+0-7module/os/freebsd/zfs/zfs_znode_os.c
+1-6include/os/linux/zfs/sys/trace_acl.h
+0-7module/os/linux/zfs/zfs_znode_os.c
+0-2module/os/linux/zfs/zfs_ctldir.c
+1-882 files not shown
+1-928 files

OpenZFS/src 97fe868tests/runfiles common.run, tests/zfs-tests/cmd mmap_ftruncate.c Makefile.am

ZTS: mmap_ftruncate test to confirm async writeback behaviour

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17584
DeltaFile
+85-0tests/zfs-tests/cmd/mmap_ftruncate.c
+80-0tests/zfs-tests/tests/functional/mmap/mmap_ftruncate.ksh
+3-1tests/zfs-tests/cmd/Makefile.am
+1-1tests/runfiles/common.run
+1-0tests/zfs-tests/cmd/.gitignore
+1-0tests/zfs-tests/include/commands.cfg
+171-21 files not shown
+172-27 files

OpenZFS/src df5e02d.github/workflows/scripts qemu-6-tests.sh

CI: match and trim out internal timestamp for test prefix

Adjust the regexes to match the test line with timestamps, then remove
them for the summary. The internal timestamp is still in the full logs.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Rob Norris <rob.norris at klarasystems.com>
Closes #17045
DeltaFile
+4-2.github/workflows/scripts/qemu-6-tests.sh
+4-21 files

OpenZFS/src 245adb6tests/test-runner/bin test-runner.py.in zts-report.py.in, tests/test-runner/include logapi.shlib

ZTS: include microsecond timestamps on all output

When reviewing test output after a failure, it's often quite difficult
to work out the order and timing of events, and to correlate test suite
output with kernel logs.

This adds timestamps to ZTS output to help with this, in three places:

- all of the standard log_XXX functions ultimately end up in _printline,
  which now prefixes output with a timestamp. An escape hatch
  environment variable is provided for user_cmd, which often calls the
  logging functions while also depending on the captured output.

- the test runner logging function log() also now prefixes its output
  with a timestamp.

- on failure, when capturing the kernel log in zfs_dmesg.ksh, the "iso"
  time format is requested.


    [6 lines not shown]
DeltaFile
+6-1tests/test-runner/include/logapi.shlib
+6-1tests/zfs-tests/callbacks/zfs_dmesg.ksh
+4-1tests/test-runner/bin/test-runner.py.in
+3-1tests/test-runner/bin/zts-report.py.in
+3-1tests/zfs-tests/include/libtest.shlib
+22-55 files

OpenZFS/src 82a0868.github/workflows/scripts qemu-3-deps-vm.sh

CI: Remove Debian backports

The latest Debian 11 image includes bullseye-backports as a default
repository in the /etc/apt/sources.list.  However, this repository
has gone end of life which effectively breaks the default install.

We shouldn't need anything in backports so lets unconditionally
remove backports on all Debian builders to resolve the issue.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #17569
DeltaFile
+1-0.github/workflows/scripts/qemu-3-deps-vm.sh
+1-01 files

OpenZFS/src e7e0bb3module Kbuild.in

linux: Fix out-of-src builds

The linux kernel modules haven't been building successfully when the
build occurs in a separate directory than the source code, which is a
common build pattern in Linux. Was not able to determine the root cause,
but the %.o targets in subdirectories are no longer being matched by the
pattern targets in the Linux Kbuild system. This change fixes the issue
by dynamically creating the missing ones inside our Kbuild.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Coleman Kane <ckane at colemankane.org>
Closes #17517 
DeltaFile
+31-0module/Kbuild.in
+31-01 files

OpenZFS/src 6af1f61cmd/zdb zdb.c, tests/zfs-tests/tests/functional/pool_checkpoint checkpoint_zdb.ksh

Fix zdb pool/ with -k

When examining the root dataset with zdb -k, we get into a mismatched
state. main() knows we are not examining the whole pool, but it strips
off the trailing slash. import_checkpointed_state() then thinks we are
examining the whole pool, and does not update the target path
appropriately. The fix is to directly inform import_checkpointed_state
that we are examining a filesystem, and not the whole pool.

Sponsored-by: Klara, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Alexander Motin <mav at FreeBSD.org>
Reviewed-by: Rob Norris <rob.norris at klarasystems.com>
Signed-off-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Co-authored-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Closes #17536
DeltaFile
+11-9cmd/zdb/zdb.c
+2-0tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_zdb.ksh
+13-92 files

OpenZFS/src 8c4f625.github/workflows zfs-qemu.yml

CI: Add CentOS Stream 9/10 to the FULL_OS runner list

Testing on CentOS Stream provides several months advance notice of
changes coming to the RHEL kernel.  This should help OpenZFS be
proactive instead of reactive to new RHEL minor versions.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Carl George <carlwgeorge at gmail.com>
ZFS-CI-Type: full
Closes #16904
Closes #17526
DeltaFile
+1-19.github/workflows/zfs-qemu.yml
+1-191 files

OpenZFS/src 7882e85. .cirrus.yml

Delete unused .cirrus.yml

The Cirrus_CI was planned for testing FreeBSD, but never really used I
think. Currently it's not needed anymore, so remove it.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Tino Reichardt <milky-zfs at mcmilk.de>
Closes #17155
Closes #17535
DeltaFile
+0-21.cirrus.yml
+0-211 files