zfs/tests/zfs-tests/cmd
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
..
checksum tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
file Corrected oversight in ZERO_RANGE behavior 2022-04-20 16:07:03 -07:00
linux_dos_attributes tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
.gitignore Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
Makefile.am Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
badsend.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
btree_test.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
chg_usr_exec.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
cp_files.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
ctime.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
devname2devid.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
dir_rd_update.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
dosmode_readonly_write.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
draid.c tests: cmd: draid: remove unused and undocumented -v 2022-04-13 11:36:29 -07:00
ereports.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
get_diff.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
getversion.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
libzfs_input_check.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mkbusy.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mkfile.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mkfiles.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mktree.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mmap_exec.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mmap_libaio.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mmap_seek.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
mmap_sync.c Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
mmapwrite.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
nvlist_to_lua.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
readmmap.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
rename_dir.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
rm_lnkcnt_zero_file.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
send_doall.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
stride_dd.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
suid_write_to_file.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
threadsappend.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
truncate_test.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
user_ns_exec.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
xattrtest.c tests: cmd: don't recurse 2022-04-01 17:58:23 -07:00
zed_fd_spill-zedlet.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00
zfs_diff-socket.c tests: move C test helpers into test cmd 2022-04-01 18:01:39 -07:00