mirror_zfs/include/os/linux/zfs/sys
Shaan Nobee 411f4a018d
Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously
Page writebacks with WB_SYNC_NONE can take several seconds to complete 
since they wait for the transaction group to close before being 
committed. This is usually not a problem since the caller does not 
need to wait. However, if we're simultaneously doing a writeback 
with WB_SYNC_ALL (e.g via msync), the latter can block for several 
seconds (up to zfs_txg_timeout) due to the active WB_SYNC_NONE 
writeback since it needs to wait for the transaction to complete 
and the PG_writeback bit to be cleared.

This commit deals with 2 cases:

- No page writeback is active. A WB_SYNC_ALL page writeback starts 
  and even completes. But when it's about to check if the PG_writeback 
  bit has been cleared, another writeback with WB_SYNC_NONE starts. 
  The sync page writeback ends up waiting for the non-sync page 
  writeback to complete.

- A page writeback with WB_SYNC_NONE is already active when a 
  WB_SYNC_ALL writeback starts. The WB_SYNC_ALL writeback ends up 
  waiting for the WB_SYNC_NONE writeback.

The fix works by carefully keeping track of active sync/non-sync 
writebacks and committing when beneficial.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Shaan Nobee <sniper111@gmail.com>
Closes #12662
Closes #12790
2022-05-03 13:23:26 -07:00
..
Makefile.am Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
policy.h Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
sha2.h module: icp: remove unused (and mostly faked) cm_{{min,max}_key_length,mech_flags} 2022-02-15 16:25:52 -08:00
trace_acl.h Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
trace_arc.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_common.h OpenZFS restructuring - move linux tracing code to platform directories 2019-09-11 14:25:53 -07:00
trace_dbgmsg.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_dbuf.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_dmu.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_dnode.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_multilist.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_rrwlock.h OpenZFS restructuring - move linux tracing code to platform directories 2019-09-11 14:25:53 -07:00
trace_txg.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_vdev.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_zfs.h Enable use of DTRACE_PROBE* macros in "spl" module 2019-11-01 13:13:43 -07:00
trace_zil.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
trace_zio.h OpenZFS restructuring - move linux tracing code to platform directories 2019-09-11 14:25:53 -07:00
trace_zrlock.h Clean up CSTYLEDs 2022-01-26 11:38:52 -08: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 Use fallthrough macro 2021-09-14 10:17:54 -06:00
zfs_ctldir.h Throw const on some strings 2020-10-02 17:44:10 -07:00
zfs_dir.h Eliminate Linux specific inode usage from common code 2019-12-11 11:53:57 -08:00
zfs_vfsops_os.h Remove unimplemented virus scanning hooks 2021-05-10 22:02:25 -07:00
zfs_vnops_os.h Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zfs_znode_impl.h module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zpl.h module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00