Skip to content

Commit

Permalink
Fast Dedup: ZAP Shrinking
Browse files Browse the repository at this point in the history
This allows ZAPs to shrink. When there are two empty sibling leafs,
one of them is collapsed and its storage space is reused.
This improved performance on directories that at one time contained
a large number of files, but many or all of those files have since
been deleted.

This also applies to all other types of ZAPs as well.

Sponsored-by: iXsystems, Inc.
Sponsored-by: Klara, Inc.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Alexander Stetsenko <[email protected]>
Closes #15888
  • Loading branch information
allanjude authored Apr 24, 2024
1 parent 67d1399 commit 5044c4e
Show file tree
Hide file tree
Showing 7 changed files with 488 additions and 12 deletions.
7 changes: 3 additions & 4 deletions man/man4/zfs.4
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.\" own identifying information:
.\" Portions Copyright [yyyy] [name of copyright owner]
.\"
.Dd January 9, 2024
.Dd February 14, 2024
.Dt ZFS 4
.Os
.
Expand Down Expand Up @@ -564,9 +564,8 @@ However, this is limited by
Maximum micro ZAP size.
A micro ZAP is upgraded to a fat ZAP, once it grows beyond the specified size.
.
.It Sy zfetch_hole_shift Ns = Ns Sy 2 Pq uint
Log2 fraction of holes in speculative prefetch stream allowed for it to
proceed.
.It Sy zap_shrink_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
If set, adjacent empty ZAP blocks will be collapsed, reducing disk space.
.
.It Sy zfetch_min_distance Ns = Ns Sy 4194304 Ns B Po 4 MiB Pc Pq uint
Min bytes to prefetch per stream.
Expand Down
Loading

0 comments on commit 5044c4e

Please sign in to comment.