Skip to content

Commit

Permalink
Tinker with slop space accounting with dedup
Browse files Browse the repository at this point in the history
Let's not include the deduplicated space usage in the slop space
reservation, it leads to surprising outcomes.

Signed-off-by: Rich Ercolani <[email protected]>
  • Loading branch information
rincebrain committed Jun 23, 2021
1 parent 069bf40 commit 4fe0d06
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion module/zfs/spa_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,12 @@ spa_get_worst_case_asize(spa_t *spa, uint64_t lsize)
uint64_t
spa_get_slop_space(spa_t *spa)
{
uint64_t space = spa_get_dspace(spa);
/*
* spa_get_dspace() includes the space only logically "used" by
* deduplicated data, so since it's not useful to reserve more
* space with more deduplicated data, we subtract that out here.
*/
uint64_t space = spa_get_dspace(spa) - spa->spa_dedup_dspace;
uint64_t slop = MIN(space >> spa_slop_shift, spa_max_slop);

/*
Expand Down

0 comments on commit 4fe0d06

Please sign in to comment.