mirror_zfs/module/os/freebsd/zfs
Alexander Motin c3773de168
ZIL: Cleanup sync and commit handling
ZVOL:
 - Mark all ZVOL ZIL transactions as sync.  Since ZVOLs have only
one object, it makes no sense to maintain async queue and on each
commit merge it into sync. Single sync queue is just cheaper, while
it changes nothing until actual commit request arrives.
 - Remove zsd_sync_cnt and the zil_async_to_sync() calls since we
are no longer switching between sync and async queues.

ZFS:
 - Mark write transactions as sync based only on number of sync
opens (z_sync_cnt).  We can not randomly jump between sync and
async unless we want data corruptions due to writes reordering.
 - When file first opened with O_SYNC (z_sync_cnt incremented to 1)
call zil_async_to_sync() for it to preserve correct ordering between
past and future writes.
 - Drop zfs_fsyncer_key logic.  Looks like it was an optimization
for workloads heavily intermixing async writes with tons of fsyncs.
But first it was broken 8 years ago due to Linux tsd implementation
not allowing data storage between syscalls, and second, I doubt it
is safe to switch from async to sync so often and without calling
zil_async_to_sync().

 - Rename sync argument of *_log_write() into commit, now only
signalling caller's intent to call zil_commit() soon after.  It
allows WR_COPIED optimizations without extra other meanings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15366
2023-10-30 14:51:56 -07:00
..
abd_os.c FreeBSD: use zero_region instead of allocating a dedicated page 2022-05-04 11:46:37 -07:00
arc_os.c FreeBSD: Remove extra arc_reduce_target_size() call 2023-03-17 17:31:08 -07:00
crypto_os.c FreeBSD: Improve crypto_dispatch() handling 2022-06-17 15:38:51 -07:00
dmu_os.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
event_os.c FreeBSD: Reduce divergence from in-tree sources 2023-10-09 13:27:18 -07:00
hkdf.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
kmod_core.c FreeBSD: Reduce divergence from in-tree sources 2023-10-09 13:27:18 -07:00
spa_os.c Fix build on FreeBSD 2023-03-22 09:24:41 -07:00
sysctl_os.c Reduce number of metaslab preload taskq threads. 2023-10-06 09:04:00 -07:00
vdev_file.c Cleanup: 64-bit kernel module parameters should use fixed width types 2022-10-13 10:03:29 -07:00
vdev_geom.c Fix build on FreeBSD 2023-03-22 09:24:41 -07:00
vdev_label_os.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_acl.c Use list_remove_head() where possible. 2023-06-09 10:12:52 -07:00
zfs_ctldir.c Fix checkstyle warning 2023-04-26 11:49:16 -07:00
zfs_debug.c Cleanup: Replace oldstyle struct hack with C99 flexible array members 2023-01-12 16:00:03 -08:00
zfs_dir.c Fix unprotected zfs_znode_dmu_fini 2023-01-19 16:59:05 -08:00
zfs_file_os.c FreeBSD: handle V_PCATCH 2022-09-20 15:22:32 -07:00
zfs_ioctl_compat.c freebsd: add ifdefs around legacy ioctl support 2022-11-07 15:55:26 -08:00
zfs_ioctl_os.c FreeBSD: make zfs_vfs_held() definition consistent with declaration 2023-04-21 10:22:52 -07:00
zfs_racct.c module: zfs: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
zfs_vfsops.c Retire z_nr_znodes 2023-09-18 16:53:33 -07:00
zfs_vnops_os.c ZIL: Cleanup sync and commit handling 2023-10-30 14:51:56 -07:00
zfs_znode.c Retire z_nr_znodes 2023-09-18 16:53:33 -07:00
zio_crypt.c Cleanup: Use kmem_zalloc() instead of memset() to zero memory 2023-01-12 15:59:28 -08:00
zvol_os.c ZIL: Cleanup sync and commit handling 2023-10-30 14:51:56 -07:00