mirror_zfs/include/sys
Alexander Motin be1e991a1a
Allow and prefer special vdevs as ZIL
Before this change ZIL blocks were allocated only from normal or
SLOG vdevs.  In typical situation when special vdevs are SSDs and
normal are HDDs it could cause weird inversions when data blocks
are written to SSDs, but ZIL referencing them to HDDs.

This change assumes that special vdevs typically have much better
(or at least not worse) latency than normal, and so in absence of
SLOGs should store ZIL blocks.  It means similar to normal vdevs
introduction of special embedded log allocation class and updating
the allocation fallback order to: SLOG -> special embedded log ->
special -> normal embedded log -> normal.

The code tries to guess whether data block is going to be written
to normal or special vdev (it can not be done precisely before
compression) and prefer indirect writes for blocks written to a
special vdev to avoid double-write.  For blocks that are going to
be written to normal vdev, special vdev by default plays as SLOG,
reducing write latency by the cost of higher special vdev wear,
but it is tunable via module parameter.

This should allow HDD pools with decent SSD as special vdev to
work under synchronous workloads without requiring additional
SLOG SSD, impractical in many scenarios.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #17505
2025-07-18 18:44:14 -07:00
..
crypto SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
fm events: include zio type in IO error reports 2025-05-30 10:29:29 -04:00
fs Introduce zfs rewrite subcommand (#17246) 2025-05-12 10:22:17 -07:00
lua SPDX: license tags: MIT 2025-03-13 17:56:54 -07:00
sysevent SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zstd SPDX: license tags: BSD-3-Clause 2025-03-13 17:56:50 -07:00
abd_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
abd.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
aggsum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
arc_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
arc.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
asm_linkage.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
avl_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
avl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bitmap.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bitops.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
blake3.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
blkptr.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bplist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bpobj.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bptree.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
bqueue.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
brt_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
brt.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
btree.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dataset_kstats.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dbuf.h ARC: Notify dbuf cache about target size reduction 2025-05-14 10:34:14 -04:00
ddt_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
ddt.h Handle interaction between gang blocks, copies, and FDT. 2025-04-21 11:26:30 -04:00
dmu_impl.h Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
dmu_objset.h Relax special_small_blocks restrictions 2025-07-02 11:11:37 -07:00
dmu_recv.h cred: properly pass and test creds on other threads (#17273) 2025-04-29 16:27:48 -07:00
dmu_redact.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dmu_send.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dmu_traverse.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dmu_tx.h dmu_tx: break tx assign/wait when pool suspends 2025-05-28 10:28:51 -07:00
dmu_zfetch.h Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
dmu.h Improve block cloning transactions accounting 2025-06-11 11:59:16 -07:00
dnode.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_bookmark.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_crypt.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_dataset.h dsl_dataset: rename dmu_objset_clone* to dsl_dataset_clone* 2025-06-10 14:52:43 -07:00
dsl_deadlist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_deleg.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_destroy.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_dir.h cred: properly pass and test creds on other threads (#17273) 2025-04-29 16:27:48 -07:00
dsl_pool.h Unified allocation throttling (#17020) 2025-03-24 09:25:01 -07:00
dsl_prop.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_scan.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_synctask.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
dsl_userhold.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
edonr.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
efi_partition.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
frame.h Linux build: silence objtool warnings 2025-06-04 17:40:09 -07:00
hkdf.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
metaslab_impl.h Include class name into struct metaslab_class 2025-06-03 11:12:59 -04:00
metaslab.h metaslab: don't pass whole zio to throttle reserve APIs 2025-07-04 23:22:22 -04:00
mmp.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
mntent.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
multilist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
nvpair_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
nvpair.h nvlist: Add nvlist_snprintf() and zfs_dbgmsg_nvlist() 2025-04-18 09:22:16 -04:00
objlist.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
pathname.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
qat.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
range_tree.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
rrwlock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sa_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sa.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sha2.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
skein.h SPDX: license tags: LicenseRef-OpenZFS-ThirdParty-PublicDomain 2025-03-13 17:57:31 -07:00
spa_checkpoint.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
spa_checksum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
spa_impl.h Allow and prefer special vdevs as ZIL 2025-07-18 18:44:14 -07:00
spa_log_spacemap.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
spa.h Allow and prefer special vdevs as ZIL 2025-07-18 18:44:14 -07:00
space_map.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
space_reftree.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sysevent.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
txg_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
txg.h txg_wait_synced_flags: add TXG_WAIT_SUSPEND flag to not wait if pool suspended 2025-05-28 10:27:46 -07:00
u8_textprep_data.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
u8_textprep.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uberblock_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uberblock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uio_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
unique.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
uuid.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_disk.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_draid.h Implement allocation size ranges and use for gang leaves (#17111) 2025-05-02 15:32:18 -07:00
vdev_file.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_impl.h mod.h: make consistent across all three platforms 2025-07-15 15:46:14 -07:00
vdev_indirect_births.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_indirect_mapping.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_initialize.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_raidz_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_raidz.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_rebuild.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_removal.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev_trim.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
vdev.h Implement dynamic gang header sizes 2025-07-09 14:02:53 -07:00
xvattr.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zap_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zap_leaf.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zap.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_global.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_iter.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_prop.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp_set.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zcp.h cred: properly pass and test creds on other threads (#17273) 2025-04-29 16:27:48 -07:00
zfeature.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_acl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_bootenv.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_chksum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_context.h libzpool: tunable-based option interface for zdb/ztest 2025-07-15 15:47:03 -07:00
zfs_debug.h nvlist: Add nvlist_snprintf() and zfs_dbgmsg_nvlist() 2025-04-18 09:22:16 -04:00
zfs_delay.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_file.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_fuid.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_ioctl_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_ioctl.h zfs_cmd: reorganise zfs_cmd_t to match original size 2025-05-27 20:01:06 -04:00
zfs_onexit.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_project.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_quota.h Show default quotas in zfs userspace tools 2025-04-03 10:36:45 -07:00
zfs_racct.h Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
zfs_ratelimit.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_refcount.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_rlock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_sa.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_stat.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_sysfs.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_vfsops.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_vnops.h Introduce zfs rewrite subcommand (#17246) 2025-05-12 10:22:17 -07:00
zfs_znode.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zil_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zil.h Allow and prefer special vdevs as ZIL 2025-07-18 18:44:14 -07:00
zio_checksum.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio_compress.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio_crypt.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zio.h Implement dynamic gang header sizes 2025-07-09 14:02:53 -07:00
zrlock.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zthr.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zvol_impl.h ZVOL: Make zvol_prefetch_bytes module parameter platform-independent 2025-05-31 09:58:54 -04:00
zvol.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00