mirror_zfs/include/os/linux/zfs/sys
Alexander Motin c935fe2e92
arc_read()/arc_access() refactoring and cleanup
ARC code was many times significantly modified over the years, that
created significant amount of tangled and potentially broken code.
This should make arc_access()/arc_read() code some more readable.

 - Decouple prefetch status tracking from b_refcnt.  It made sense
originally, but became highly cryptic over the years.  Move all the
logic into arc_access().  While there, clean up and comment state
transitions in arc_access().  Some transitions were weird IMO.
 - Unify arc_access() calls to arc_read() instead of sometimes calling
it from arc_read_done().  To avoid extra state changes and checks add
one more b_refcnt for ARC_FLAG_IO_IN_PROGRESS.
 - Reimplement ARC_FLAG_WAIT in case of ARC_FLAG_IO_IN_PROGRESS with
the same callback mechanism to not falsely account them as hits. Count
those as "iohits", an intermediate between "hits" and "misses". While
there, call read callbacks in original request order, that should be
good for fairness and random speculations/allocations/aggregations.
 - Introduce additional statistic counters for prefetch, accounting
predictive vs prescient and hits vs iohits vs misses.
 - Remove hash_lock argument from functions not needing it.
 - Remove ARC_FLAG_PREDICTIVE_PREFETCH, since it should be opposite
to ARC_FLAG_PRESCIENT_PREFETCH if ARC_FLAG_PREFETCH is set.  We may
wish to add ARC_FLAG_PRESCIENT_PREFETCH to few more places.
 - Fix few false positive tests found in the process.

Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #14123
2022-12-22 12:10:24 -08:00
..
policy.h Support idmapped mount in user namespace 2022-11-08 10:28:56 -08:00
sha2.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_acl.h Remove zpl_revalidate: fix snapshot rollback 2022-10-28 09:47:19 -07:00
trace_arc.h arc_read()/arc_access() refactoring and cleanup 2022-12-22 12:10:24 -08:00
trace_common.h Fix zio_flag_t print format 2022-10-28 09:08:12 -07:00
trace_dbgmsg.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_dbuf.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_dmu.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_dnode.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_multilist.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_rrwlock.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_txg.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_vdev.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_zfs.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_zil.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_zio.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
trace_zrlock.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_bootenv_os.h zfs label bootenv should store data as nvlist 2020-09-15 15:42:27 -07:00
zfs_context_os.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_ctldir.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_dir.h zfs_rename: restructure to have cleaner fallbacks 2022-10-28 09:48:58 -07:00
zfs_vfsops_os.h Retire ZFS_TEARDOWN_TRY_ENTER_READ 2022-09-20 15:34:41 -07:00
zfs_vnops_os.h zfs_rename: support RENAME_* flags 2022-10-28 09:49:20 -07:00
zfs_znode_impl.h zfs_enter rework 2022-09-16 13:36:47 -07:00
zpl.h zfs_rename: support RENAME_* flags 2022-10-28 09:49:20 -07:00