Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gang before embedded slog (openzfs#233)
On very fragmented pools, there may be no large free chunks in the normal allocation class (e.g. ~64KB, the size of compressed indirect blocks). This will cause the allocation to fall back on the embedded slog metaslab. This can cause the embedded slog metaslab to become full/fragmented enough that ZIL allocations fail, causing sync writes to fall back on txg_wait_synced(), which is very very slow. To address this problem, this commit makes allocations try to gang before allowing the embedded slog metaslab to be used for normal allocations. Although ganging is slow (it's roughly 25% of normal performance, because we do ~4 writes for each block), it's much better than sync writes whose ZIL allocation fails, which can be 0.1% normal performance (txg_wait_synced() could take 10 seconds compared to a 10ms write). Additionally, when writing a Gang Block Header (GBH), if the allocation from the normal class fails, retry it from the embedded slog. The GBH is 512 bytes, so it can only fail when the class is completely full. This change doesn't impact performance but it prevents an unnecessary allocation failure on small, extremely full pools, where there is zero free space in the normal class.
- Loading branch information