diff options
author | Shaan Nobee <[email protected]> | 2022-05-04 00:23:26 +0400 |
---|---|---|
committer | GitHub <[email protected]> | 2022-05-03 13:23:26 -0700 |
commit | 411f4a018d7a5672701975b4fd8a697ddff16f33 (patch) | |
tree | 9b186e1b603b7cdfdc0c4cb292c76e7607346d88 /tests/runfiles/common.run | |
parent | a64d757aa4d4796af540ebe2a098e82c94ccbfcf (diff) |
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 <[email protected]>
Signed-off-by: Shaan Nobee <[email protected]>
Closes #12662
Closes #12790
Diffstat (limited to 'tests/runfiles/common.run')
-rw-r--r-- | tests/runfiles/common.run | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run index b8310264a..1930dfab1 100644 --- a/tests/runfiles/common.run +++ b/tests/runfiles/common.run @@ -681,7 +681,7 @@ tests = ['migration_001_pos', 'migration_002_pos', 'migration_003_pos', tags = ['functional', 'migration'] [tests/functional/mmap] -tests = ['mmap_write_001_pos', 'mmap_read_001_pos', 'mmap_seek_001_pos'] +tests = ['mmap_write_001_pos', 'mmap_read_001_pos', 'mmap_seek_001_pos', 'mmap_sync_001_pos'] tags = ['functional', 'mmap'] [tests/functional/mount] |