mirror_zfs/module/os/linux/zfs
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
..
abd_os.c Adding ZERO_PAGE detection 2022-03-14 12:37:39 -07:00
arc_os.c Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
mmp_os.c Add zfs_multihost_interval tunable handler for FreeBSD 2020-06-23 13:32:42 -07:00
policy.c Fix ACL checks for NFS kernel server 2022-03-18 06:47:57 -06:00
qat_compress.c Modify checksum obtain method of QAT 2021-08-03 11:46:33 -06:00
qat_crypt.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
qat.c QAT related bug fixes 2019-09-12 13:33:44 -07:00
spa_misc_os.c Add spa _os() hooks 2022-02-15 15:54:25 -08:00
trace.c Enable use of DTRACE_PROBE* macros in "spl" module 2019-11-01 13:13:43 -07:00
vdev_disk.c Linux 5.18 compat: blkg_tryget is moved to private headers 2022-04-04 09:35:11 -07:00
vdev_file.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_acl.c Linux optimize access checks when ACL is trivial 2022-04-01 09:53:54 -07:00
zfs_ctldir.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zfs_debug.c module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zfs_dir.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
zfs_file_os.c file reference counts can get corrupted 2021-07-10 19:00:37 -06:00
zfs_ioctl_os.c linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
zfs_racct.c module: zfs: fix unused, remove argsused 2021-12-23 09:42:47 -08:00
zfs_sysfs.c Linux 5.18 compat: kobj_type.default_attrs replaced with default_groups 2022-04-22 14:27:10 -07:00
zfs_uio.c PPC get_user workaround 2022-04-26 10:52:40 -07:00
zfs_vfsops.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
zfs_vnops_os.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zfs_znode.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zio_crypt.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
zpl_ctldir.c module: mark arguments used 2022-02-18 09:34:03 -08:00
zpl_export.c Return required size when encode_fh size too small 2021-05-07 15:08:16 -07:00
zpl_file.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
zpl_inode.c Fix ACL checks for NFS kernel server 2022-03-18 06:47:57 -06:00
zpl_super.c Linux: Fix ZFS_ENTER/ZFS_EXIT/ZFS_VERFY_ZP usage 2020-11-14 10:19:00 -08:00
zpl_xattr.c Fix ACL checks for NFS kernel server 2022-03-18 06:47:57 -06:00
zvol_os.c Linux 5.17 compat: GENHD_FL_EXT_DEVT / GENHD_FL_NO_PART_SCAN 2022-04-19 10:38:04 -07:00