summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Re-share zfsdev_getminor and zfs_onexit_fd_holdMatthew Macy2020-02-287-100/+81
| | | | | | | | | | By adding a zfs_file_private accessor to the common interfaces and some extensions to FreeBSD platform code it is now possible to share the implementations for the aforementioned functions. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10073
* Improve zfs destroy performance with zio_t-free zio_free()Matthew Ahrens2020-02-286-33/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | When "zfs destroy" is run, it completes quickly, and in the background we locate the blocks to free and free them. This background activity can be observed with `zpool get freeing` and `zpool wait -t free ...`. This background activity is processed by a single thread (the spa_sync thread) which calls zio_free() on each of the blocks to free. With even modest storage performance, the CPU consumption of zio_free() can be the performance bottleneck. Performance of zio_free() can be improved by not actually creating a zio_t in the common case (non-dedup, non-gang), instead calling metaslab_free() directly. This avoids the CPU cost of allocating the zio_t, and more importantly the cost of adding and later removing this zio_t from the parent zio's child list. The result is that performance of background freeing more than doubles, from 0.6 million blocks per second to 1.3 million blocks per second. Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Serapheim Dimitropoulos <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Wilson <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10034
* ZTS: Fixup shebang in rsend_016, add to common.runRyan Moeller2020-02-282-2/+2
| | | | | | | | | | | | | | All other ksh scripts use /bin/ksh in the shebang. Make rsend_016_neg consistent with the rest of the suite. The test also was absent from any runfiles. Add it to common.run. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10051
* ZTS: Eliminate partitioning from zpool_addRyan Moeller2020-02-2813-218/+72
| | | | | | | | | Use file vdevs if we are short on $DISKS. Also fixed vol recursion for FreeBSD in 004. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10060
* Fix CONFIG_MODULES=no Linux kernel configBrian Behlendorf2020-02-281-4/+13
| | | | | | | | | | | | | | When configuring as builtin (--enable-linux-builtin) for kernels without loadable module support (CONFIG_MODULES=n) only the object file is created. Never a loadable kmod. Update ZFS_LINUX_TRY_COMPILE to handle this in a manor similar to the ZFS_LINUX_TEST_COMPILE_ALL macro. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #9887 Closes #10063
* Linux 5.5 compat: blkg_tryget()Brian Behlendorf2020-02-282-1/+71
| | | | | | | | | | | | | Commit https://github.com/torvalds/linux/commit/9e8d42a0f accidentally converted the static inline function blkg_tryget() to GPL-only for kernels built with CONFIG_PREEMPT_RCU=y and CONFIG_BLK_CGROUP=y. Resolve the build issue by providing our own equivalent functionality when needed which uses rcu_read_lock_sched() internally as before. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #9745 Closes #10072
* arc_summary: Make get_descriptions per platformRyan Moeller2020-02-271-53/+76
| | | | | | | | | | | Linux uses modinfo to get tunables descriptions, FreeBSD has to use sysctl. Move the existing function definition so it is defined that way on Linux, and add a definition in terms of sysctl for FreeBSD. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10062
* pyzfs: Add constants for platform-specific errnosRyan Moeller2020-02-273-6/+25
| | | | | | | | | FreeBSD doesn't have EBADE, ECHRNG, or ETIME. Add constants for these and set them appropriately for the platform. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10061
* Consolidate arc_buf allocation checksMatthew Macy2020-02-271-72/+42
| | | | | | | | | | | | | | | | | The following check currently occurs in three separate locations in dbuf.c. This change consolidates those checks in to the dbuf_alloc_arcbuf_from_arcbuf() function. if (arc_is_encrypted(data)) { ... } else if (compress_type != ZIO_COMPRESS_OFF) { ... } else { ... } Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10057
* ZTS: Misc fixes for FreeBSDRyan Moeller2020-02-279-53/+34
| | | | | | | | | | | | | * Set geom debug flags in corrupt_blocks_at_level * Use the right time zone for history tests * Add missing commands.cfg entry for diskinfo * Rewrite get_last_txg_synced to use zdb * Don't check ulimits for sparse files * Suspend removal before removing a vdev, not after Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10054
* ZTS: Fix zfs_receive_004_negMatthew Ahrens2020-02-272-7/+1
| | | | | | | | | | | | | | | | | | | | | `zfs recv` of an incremental stream that already exists is ignored, with a message like: receiving incremental stream of pool/fs@incsnap into pool/fs@incsnap snap testpool/testfs@incsnap already exists; ignoring And the command exits successfully (exit code 0). The zfs_receive_004_neg test is expecting that a this case will fail, with nonzero exit code. The fix is to remove this specific command from the test case. This lets us check that the remaining commands do in fact fail. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10055
* Linux 5.6 compat: time_tBrian Behlendorf2020-02-276-7/+7
| | | | | | | | | | | | | | | | | | | As part of the Linux kernel's y2038 changes the time_t type has been fully retired. Callers are now required to use the time64_t type. Rather than move to the new type, I've removed the few remaining places where a time_t is used in the kernel code. They've been replaced with a uint64_t which is already how ZFS internally handled these values. Going forward we should work towards updating the remaining user space time_t consumers to the 64-bit interfaces. Reviewed-by: Matthew Macy <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10052 Closes #10064
* Linux 5.6 compat: ktime_get_raw_ts64()Brian Behlendorf2020-02-274-25/+62
| | | | | | | | | | | The getrawmonotonic() and getrawmonotonic64() interfaces have been fully retired. Update gethrtime() to use the replacement interface ktime_get_raw_ts64() which was introduced in the 4.18 kernel. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #10052 Closes #10064
* Refactor dnode dirty context from dbuf_dirtyMatthew Macy2020-02-2619-83/+92
| | | | | | | | | | | * Add dedicated donde_set_dirtyctx routine. * Add empty dirty record on destroy assertion. * Make much more extensive use of the SET_ERROR macro. Reviewed-by: Will Andrews <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9924
* ZTS: Fix zfs_copies_002_posRyan Moeller2020-02-261-1/+1
| | | | | | | | | | | The function `get_used_prop` does not exist. Use `get_prop used` instead. Reviewed-by: George Melikov <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10059
* ZTS: Adapt casenorm tests for FreeBSDRyan Moeller2020-02-262-10/+10
| | | | | | | | | | | | | | | | Several casenorm tests pass on FreeBSD but are expected to fail on Linux. Move the passing tests from "fail" to "maybe" so that passing on FreeBSD is not unexpected. Invert platform logic so FreeBSD doesn't use illumos-only zlook. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10050
* ZTS: Misc fixes for FreeBSDRyan Moeller2020-02-258-26/+35
| | | | | | | | | | | | * Check for mountd in is_shared to avoid timeout when not running * Enhance robustness of some cleanup functions * Simplify atime lookup * Skip sharenfs validation for now * Don't add mountpoint property to inheritance validation on FreeBSD Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10047
* Add missing newline after zfs redact help messageRyan Moeller2020-02-251-1/+1
| | | | | Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10045
* ZTS: zed_start should not fail if zed is already runningOlaf Faaland2020-02-251-8/+8
| | | | | | | | | zed_start may be called in places where zed is not typically already running, but this is not a requirement of the tests. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Olaf Faaland <[email protected]> Closes #9974
* Remove dead code error handling from dsl_crypt.cMatthew Macy2020-02-251-29/+3
| | | | | | | | | Sleepable (KM_SLEEP) allocations cannot fail. Hence error handling for them is not useful. Reviewed-By: Tom Caputi <[email protected]> Reviewed-By: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10031
* ZTS: Move atime_003 to linux.runRyan Moeller2020-02-252-3/+2
| | | | | | | | | | | This test verifies relatime behavior, which is only present on Linux. Move the test to linux.run Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10046
* Update README for OpenZFSMatthew Ahrens2020-02-251-12/+17
| | | | | Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10053
* Remove zfs_getattr and convoff dead codeDirkjan Bussink2020-02-244-269/+1
| | | | | | | | | | | | The `convoff` function is called only in one code path in `zfs_space`. Each caller of `zfs_space` is called with a `flock64_t` that has `l_whence` set to `SEEK_SET`. This means that `convoff` always results in a no-op as the `bfp` parameter has `l_whence` set to `SEEK_SET` and `int whence` is `SEEK_SET` as well. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]> Closes #10006
* ZTS: Misc fixes for FreeBSDRyan Moeller2020-02-248-14/+46
| | | | | | | | | | | | | * Force UFS sync before snap in vol rollback tests * rw is not a valid share option on FreeBSD, use ro instead * zfs_unmount_nested: mountpoint is in the pool, rmdir *before* export * Fix some more platform checks * Fix disappearing group in delegate tests * Don't try delegating for jailed, only root can set it Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10038
* Remove unused structs and members in dmu_send.cMatthew Ahrens2020-02-241-32/+0
| | | | | | | | | | There are several structs (and members of structs) related to redaction, which are no longer used. This commit removes them. Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10039
* ZTS: Eliminate partitioning from zpool_destroyRyan Moeller2020-02-213-23/+10
| | | | | | | | | | | The zpool destroy tests partition a single disk to create two pools. This can be done using two disks and no partitioning instead. And temporarily allow vol recursion for FreeBSD while in here. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10036
* ZTS: Refactor is_shared, fix impl on FreeBSDRyan Moeller2020-02-213-17/+29
| | | | | | | | | | | | FreeBSD doesn't have a `share` command. It does have showmount. Split the separate platform impls out of is_shared_impl. Dispatch to the correct platform impl function from is_shared. Eliminate the use of is_shared_impl from tests. is_shared works. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10037
* ZTS: Move privilege tests to sunos.runRyan Moeller2020-02-213-8/+4
| | | | | | | | | | These tests are unspported on FreeBSD and Linux for lack of pfexec. Move the privilege tests to sunos.run and remove the platform checks. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10035
* ZTS: Don't use lsblk on FreeBSDRyan Moeller2020-02-212-2/+10
| | | | | | | | | | | | | These tests use lsblk to find the sector size of a disk. FreeBSD doesn't have lsblk. Use diskinfo -v to get sector size on FreeBSD. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]>\ Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10033
* ZTS: Fix userquota_006_pos on FreeBSDRyan Moeller2020-02-201-1/+5
| | | | | | | | | | | | FreeBSD uses `pw` for account management. `userquota_006_pos` erroneously invokes the non-existent `groupdel` command on FreeBSD. Use `pw groupdel -n` instead of `groupdel` on FreeBSD. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10032
* ZTS: Check the right mount options on FreeBSDRyan Moeller2020-02-201-5/+13
| | | | | | | | | | FreeBSD does not support the "devices" and "nodevices" mount options. Do not check these options on FreeBSD. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10028
* ZTS: Fix faulty slog_replay_fs_001 testRyan Moeller2020-02-201-13/+21
| | | | | | | | | | | | | | This test is supposed to verify zil operations. For TX_WRITE, writes must be synchronous in order to be entered in the zil. Linux seems to be doing sync writes even when they are not asked for, but on FreeBSD the test does not do what is intended. Use dd oflag=sync for the parts of this test that are supposed to result in TX_WRITE zil entries. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10022
* Fix icp include directories for in-tree buildArvind Sankar2020-02-201-2/+2
| | | | | | | | | | | | | | When zfs is built in-tree using --enable-linux-builtin, the compile commands are executed from the kernel build directory. If the build directory is different from the kernel source directory, passing -Ifs/zfs/icp will not find the headers as they are not present in the build directory. Fix this by adding @abs_top_srcdir@ to pull the headers from the zfs source tree instead. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10021
* ZTS: Eliminate partitioning from zpool_create etcRyan Moeller2020-02-2035-787/+219
| | | | | | | | | | | | | | | | These tests can be made to work without a bunch of complex partitioning of physical disks. Use the 3 disks directly, creating a few file disks if needed for a compelling reason. Reduce the use of shared variables that don't have a clear utility. Catch the fallout in tests that include cfg/shlib from zpool_create. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10002
* ZTS: Fix zpool_create/create-o_ashift on FreeBSDRyan Moeller2020-02-191-5/+11
| | | | | | | | | | | | | | | For some unknown reason, egrep was misbehaving with this pattern on FreeBSD. The command works fine run interactively from a shell, but in the test the output of egrep is empty. Work around the issue by using a filter in the awk script instead. While here, add a bit of diagnostic output and other simplifications to the awk script as well. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10023
* ZTS: Avoid nonportable cmp flagRyan Moeller2020-02-191-2/+5
| | | | | | | | | | | FreeBSD doesn't have the -n flag for cmp. Read the area for the first four labels from the disk to a separate file to compare instead of using the special flag to limit the size. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10024
* Add notice that forcefully unmount is not supported on LinuxMariusz Zaborski2020-02-182-2/+4
| | | | | | | | | | | The Linux VFS will never allow a filesystem which is in use to be unmounted. This behavior differs from other platforms like FreeBSD which allow a filesystem to be force unmounted. This will result in errors being returned to applications actively using the filesystem. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Mariusz Zaborski <[email protected]> Closes #10013
* ZTS: Move free to Linux commands listRyan Moeller2020-02-181-1/+1
| | | | | | | | | | | | FreeBSD does not have the free command. This command is only used by Linux in a perf hostinfo function. Move free from the list of common commands to the list of Linux commands. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10011
* Enable zpool events tunables and tests on FreeBSDRyan Moeller2020-02-188-23/+21
| | | | | | | | | | | | | | We have have made the necessary changes in our module code to expose zevents through both devd and the zpool events ioctl. Now the tunables can be exposed and zpool events tests can be enabled on both platforms. A few minor tweaks to the tests were needed to accommodate the way wc formats output on FreeBSD. zed remains to be ported. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10008
* Factor out some dbuf subroutines and add state change tracingMatthew Macy2020-02-182-93/+160
| | | | | | | | | | | | Create dedicated dbuf_read_hole and dbuf_read_bonus. Additionally, add a dtrace probe to allow state change tracing. Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Will Andrews <[email protected]> Reviewed by: Brad Lewis <[email protected]> Authored-by: Will Andrews <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9923
* Prefer org.openzfs for features and propertiesRichard Laager2020-02-184-15/+26
| | | | | | | | | | Moving forward, we wish to use org.openzfs (no dash) rather than org.open-zfs or org.zfsonlinux for feature GUIDs and property names. The existing feature GUIDs cannot be changed. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Richard Laager <[email protected]> Closes #10003
* ZTS: Move cksum to common system commandsRyan Moeller2020-02-161-1/+1
| | | | | | | | | | | The cksum command is used by delegate tests. We have it on FreeBSD, so it should not have been moved to the Linux commands list. Move it back to the common commands list. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10007
* Honour sync=disabled when relinking tpmfilesDeHackEd2020-02-161-1/+1
| | | | | | | | | | | Unlinked files don't respect synchronous flush commands, but when they get relinked their state is unknown. Previously we force flushed all such files even when sync=disabled. Correct this case. Reviewed-by: Chunwei Chen <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: DHE <[email protected]> Closes #10005
* Systemd mount generator: Generate noauto units; add control propertiesInsanePrawn2020-02-144-44/+384
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors the systemd mount generators and makes the following major changes: - The generator now generates units for datasets marked canmount=noauto, too. These units are NOT WantedBy local-fs.target. If there are multiple noauto datasets for a path, no noauto unit will be created. Datasets with canmount=on are prioritized. - Introduces handling of new user properties which are now included in the zfs-list.cache files: - org.openzfs.systemd:requires: List of units to require for this mount unit - org.openzfs.systemd:requires-mounts-for: List of mounts to require by this mount unit - org.openzfs.systemd:before: List of units to order after this mount unit - org.openzfs.systemd:after: List of units to order before this mount unit - org.openzfs.systemd:wanted-by: List of units to add a Wants dependency on this mount unit to - org.openzfs.systemd:required-by: List of units to add a Requires dependency on this mount unit to - org.openzfs.systemd:nofail: Toggles between a wants and a requires dependency. - org.openzfs.systemd:ignore: Do not generate a mount unit for this dataset. Consult the updated man page for detailed documentation. - Restructures and extends the zfs-mount-generator(8) man page with the above properties, information on unit ordering and a license header. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9649
* Systemd mount generator: Silence shellcheck warningsInsanePrawn2020-02-141-11/+14
| | | | | | | | | | | | Silences a warning about an intentionally unquoted variable. Fixes a warning caused by strings split across lines by slightly refactoring keyloadcmd. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Antonio Russo <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9649
* Support setting user properties in a channel programJason King2020-02-1411-3/+361
| | | | | | | | | | | | | This adds support for setting user properties in a zfs channel program by adding 'zfs.sync.set_prop' and 'zfs.check.set_prop' to the ZFS LUA API. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matt Ahrens <[email protected]> Co-authored-by: Sara Hartse <[email protected]> Contributions-by: Jason King <[email protected]> Signed-off-by: Sara Hartse <[email protected]> Signed-off-by: Jason King <[email protected]> Closes #9950
* Remove limit on number of async zio_frees of non-dedup blocksMatthew Ahrens2020-02-143-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | The module parameter zfs_async_block_max_blocks limits the number of blocks that can be freed by the background freeing of filesystems and snapshots (from "zfs destroy"), in one TXG. This is useful when freeing dedup blocks, becuase each zio_free() of a dedup block can require an i/o to read the relevant part of the dedup table (DDT), and will also dirty that block. zfs_async_block_max_blocks is set to 100,000 by default. For the more typical case where dedup is not used, this can have a negative performance impact on the rate of background freeing (from "zfs destroy"). For example, with recordsize=8k, and TXG's syncing once every 5 seconds, we can free only 160MB of data per second, which may be much less than the rate we can write data. This change increases zfs_async_block_max_blocks to be unlimited by default. To address the dedup freeing issue, a new tunable is introduced, zfs_max_async_dedup_frees, which limits the number of zio_free()'s of dedup blocks done by background destroys, per txg. The default is 100,000 free's (same as the old zfs_async_block_max_blocks default). Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #10000
* Make zpool.d/iostat work on FreeBSDRyan Moeller2020-02-141-8/+20
| | | | | | | | There are slight differences in the iostat commands between FreeBSD and Linux. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9979
* Use POSIX stdout/stderr redirect in configure macroAndrew J. Hesford2020-02-141-1/+1
| | | | | | | | | | | | This PR fixes an issue wherein redirecting stdout and stderr when building kernel modules in configure tests relied on a bashism that does not work as expected when /bin/sh is not bash. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-By: Richard Laager <[email protected]> Signed-off-by: Andrew J. Hesford <[email protected]> Closes #9990 Closes #9998
* ZTS: Misc test fixes for FreeBSDRyan Moeller2020-02-1312-41/+85
| | | | | | | | Add missing logic for FreeBSD to a few test scripts. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9994