mirror_zfs/module/os/freebsd/zfs
Alexander Motin 734eba251d
Wire O_DIRECT also to Uncached I/O (#17218)
Before Direct I/O was implemented, I've implemented lighter version
I called Uncached I/O.  It uses normal DMU/ARC data path with some
optimizations, but evicts data from caches as soon as possible and
reasonable.  Originally I wired it only to a primarycache property,
but now completing the integration all the way up to the VFS.

While Direct I/O has the lowest possible memory bandwidth usage,
it also has a significant number of limitations.  It require I/Os
to be page aligned, does not allow speculative prefetch, etc.  The
Uncached I/O does not have those limitations, but instead require
additional memory copy, though still one less than regular cached
I/O.  As such it should fill the gap in between.  Considering this
I've disabled annoying EINVAL errors on misaligned requests, adding
a tunable for those who wants to test their applications.

To pass the information between the layers I had to change a number
of APIs.  But as side effect upper layers can now control not only
the caching, but also speculative prefetch.  I haven't wired it to
VFS yet, since it require looking on some OS specifics.  But while
there I've implemented speculative prefetch of indirect blocks for
Direct I/O, controllable via all the same mechanisms.

Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Fixes #17027
Reviewed-by: Rob Norris <robn@despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
2025-05-13 14:26:55 -07:00
..
abd_os.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
arc_os.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
crypto_os.c SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
dmu_os.c Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
event_os.c FreeBSD: remove support for FreeBSD < 13.0-RELEASE (#16372) 2024-08-05 16:56:45 -07:00
hkdf.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
kmod_core.c SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
spa_os.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
sysctl_os.c SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
vdev_geom.c Implement allocation size ranges and use for gang leaves (#17111) 2025-05-02 15:32:18 -07:00
vdev_label_os.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_acl.c dmu_tx: rename dmu_tx_assign() flags from TXG_* to DMU_TX_* (#17143) 2025-03-18 16:04:22 -07:00
zfs_ctldir.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_debug.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zfs_dir.c dmu_tx: rename dmu_tx_assign() flags from TXG_* to DMU_TX_* (#17143) 2025-03-18 16:04:22 -07:00
zfs_file_os.c SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
zfs_ioctl_compat.c SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
zfs_ioctl_os.c SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
zfs_racct.c Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
zfs_vfsops.c Report default quotas via kernel interfaces 2025-04-03 10:36:38 -07:00
zfs_vnops_os.c Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00
zfs_znode_os.c FreeBSD: Use new SYSCTL_SIZEOF() 2025-05-08 10:31:43 -04:00
zio_crypt.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
zvol_os.c Wire O_DIRECT also to Uncached I/O (#17218) 2025-05-13 14:26:55 -07:00