Files
mirror_zfs/module/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
..
2022-02-15 08:58:59 -08:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2019-07-26 10:54:14 -07:00
2022-03-15 15:13:42 -07:00
2019-06-19 09:48:12 -07:00
2022-03-15 15:13:42 -07:00
2022-01-26 11:38:52 -08:00
2022-03-15 15:13:42 -07:00
2020-11-02 11:51:12 -08:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-02-18 09:34:03 -08:00
2022-01-26 11:38:52 -08:00
2022-04-26 10:44:21 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-01-14 15:37:55 -08:00
2022-03-15 15:13:42 -07:00
2022-01-07 10:36:49 -08:00
2022-01-12 16:14:36 -08:00
2022-04-26 10:44:21 -07:00
2022-01-26 11:38:52 -08:00
2019-06-19 09:48:12 -07:00
2022-03-15 15:13:42 -07:00
2020-07-29 16:35:33 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2020-06-18 12:21:25 -07:00
2022-01-26 11:38:52 -08:00
2022-02-18 09:34:03 -08:00
2022-03-15 15:13:42 -07:00
2022-01-26 11:38:52 -08:00
2022-04-26 10:44:21 -07:00
2022-03-15 15:13:42 -07:00
2019-10-09 10:36:03 -07:00
2022-01-26 11:38:52 -08:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-01-26 11:38:52 -08:00
2022-01-26 11:38:52 -08:00
2022-03-15 15:13:42 -07:00
2022-04-26 10:44:21 -07:00
2020-11-13 13:51:51 -08:00
2022-04-26 10:44:21 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-01-26 11:38:52 -08:00
2022-02-18 09:34:03 -08:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-03-15 15:13:42 -07:00
2022-04-28 15:12:24 -07:00
2020-06-18 12:21:25 -07:00
2020-06-18 12:21:18 -07:00