zfs/tests/zfs-tests/cmd
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
..
badsend Drop references when skipping dmu_send due to EXDEV 2020-09-30 13:19:49 -07:00
btree_test Use the correct return type for getopt 2020-12-17 10:19:30 -08:00
chg_usr_exec Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
devname2devid ZTS: Fix devname2devid build on FreeBSD with libudev 2020-07-22 10:49:22 -07:00
dir_rd_update Use cstyle -cpP in `make cstyle` check 2016-12-12 10:46:26 -08:00
draid tests: cmd: draid: remove unused and undocumented -v 2022-12-01 12:39:44 -08:00
file_check tests/file_check: remove unused variable 2021-12-06 13:52:34 -08:00
file_trunc Enable remaining tests 2017-05-22 12:34:32 -04:00
file_write Corrected oversight in ZERO_RANGE behavior 2022-04-21 16:58:07 -07:00
get_diff Add missing .gitignore from "Implement Redacted Send/Receive" 2019-06-23 11:51:29 -07:00
largest_file OpenZFS restructuring - libspl 2019-10-02 10:39:48 -07:00
libzfs_input_check implicit conversion from 'boolean_t' to 'ds_hold_flags_t' 2020-12-27 16:31:02 -08:00
mkbusy Fix typos 2020-06-09 21:24:09 -07:00
mkfile tests: mkfile: usage: () -> (void) 2022-12-09 12:07:38 -08:00
mkfiles Update ZTS to work on FreeBSD 2019-12-18 12:29:43 -08:00
mktree Update ZTS to work on FreeBSD 2019-12-18 12:29:43 -08:00
mmap_exec Enable remaining tests 2017-05-22 12:34:32 -04:00
mmap_libaio Clean up lib dependencies 2020-07-10 14:26:00 -07:00
mmap_seek zfs-test/mmap_seek: fix build on musl 2022-02-16 17:58:55 -08:00
mmap_sync Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2023-06-05 10:59:02 -07:00
mmapwrite ZTS: close in mmapwrite.c 2023-01-09 17:15:22 -08:00
nvlist_to_lua Use abs_top_builddir when referencing libraries 2020-07-10 14:26:32 -07:00
randfree_file Fix coverity defects: CID 147692, 147693, 147694 2016-10-13 14:38:59 -07:00
randwritecomp OpenZFS 9166 - zfs storage pool checkpoint 2018-06-26 10:07:42 -07:00
readmmap Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
rename_dir Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
rm_lnkcnt_zero_file Prefer `for (;;)` to `while (TRUE)` 2019-08-28 10:38:40 -07:00
send_doall send_iterate_snap : doall send without fromsnap 2021-02-24 09:48:58 -08:00
stride_dd Implement Redacted Send/Receive 2019-06-19 09:48:12 -07:00
threadsappend Add the ZFS Test Suite 2016-03-16 13:46:16 -07:00
user_ns_exec Take user namespaces into account in policy checks 2018-03-07 15:40:42 -08:00
xattrtest Support uClibc for the tests compilations 2021-02-16 21:51:46 -08:00
Makefile.am Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2023-06-05 10:59:02 -07:00
file_common.h Enable remaining tests 2017-05-22 12:34:32 -04:00