zfs/tests/zfs-tests/include
Shaan Nobee 9e5a297de6 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
2023-06-05 10:59:02 -07:00
..
.gitignore Add zpool events tests 2017-05-22 12:34:42 -04:00
Makefile.am Centralize variable substitution 2020-07-14 17:33:44 -07:00
blkdev.shlib egrep -> grep -E 2023-01-19 12:50:25 -08:00
commands.cfg Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2023-06-05 10:59:02 -07:00
default.cfg.in Add "compatibility" property for zpool feature sets 2021-02-17 21:30:45 -08:00
libtest.shlib zed: mark disks as REMOVED when they are removed 2023-03-27 11:32:09 -07:00
math.shlib ZTS: Make bc conditional use compatible with new BSD bc 2020-07-09 17:49:02 -07:00
properties.shlib Add options to zfs redundant_metadata property 2022-11-01 12:25:58 -07:00
tunables.cfg Improve too large physical ashift handling 2022-09-21 13:15:15 -07:00
zpool_script.shlib zfs-tests: fix warnings when packaging some .shlib files 2019-05-24 14:12:14 -07:00