Skip to content

Introduce dedupused/dedupsaved pool properties#18245

Merged
amotin merged 1 commit intoopenzfs:masterfrom
amotin:dedupused
Feb 25, 2026
Merged

Introduce dedupused/dedupsaved pool properties#18245
amotin merged 1 commit intoopenzfs:masterfrom
amotin:dedupused

Conversation

@amotin
Copy link
Member

@amotin amotin commented Feb 20, 2026

Currently there is only a dedup ratio reported via pool properties. If dedup is enabled only for some datasets, it is impossible to say how much space the ratio actually covers. Fix this by introducing dedupused/dedupsaved pool properties, similar to earlier added block cloning ones. Combined with work to expose allocation classes stats, it should give user-space enough visibility to correlate zpool list and zfs list space numbers.

How Has This Been Tested?

mav@genoa1:/optane# zpool get all | egrep ' (dedup|bclo)'
optane  dedupratio                     5.00x                          -
optane  bcloneused                     0                              -
optane  bclonesaved                    0                              -
optane  bcloneratio                    1.00x                          -
optane  dedup_table_size               288K                           -
optane  dedup_table_quota              auto                           default
optane  dedupused                      65M                            -
optane  dedupsaved                     260M                           -

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@amotin amotin added the Status: Code Review Needed Ready for review and testing label Feb 20, 2026
@ryan-moeller
Copy link

ryan-moeller commented Feb 23, 2026

These properties can be added to tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_parsable.cfg as well. It looks like the values should always be parsable.

dedupused will be redundant with dedup_stats.deflated_size in the json status output, but that is harmless.

@ryan-moeller
Copy link

I'll bump the man page date in #18238 after this.

@amotin
Copy link
Member Author

amotin commented Feb 24, 2026

These properties can be added to tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get_parsable.cfg as well. It looks like the values should always be parsable.

Added.

Currently there is only a dedup ratio reported via pool properties.
If dedup is enabled only for some datasets, it is impossible to say
how much space the ratio actually covers.  Fix this by introducing
dedupused/dedupsaved pool properties, similar to earlier added
block cloning ones.  Combined with work to expose allocation classes
stats, it should give user-space enough visibility to correlate
`zpool list` and `zfs list` space numbers.

Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
@amotin amotin merged commit 991fc56 into openzfs:master Feb 25, 2026
25 of 26 checks passed
@amotin amotin deleted the dedupused branch February 25, 2026 14:41
ixhamza pushed a commit to truenas/zfs that referenced this pull request Feb 25, 2026
Currently there is only a dedup ratio reported via pool properties.
If dedup is enabled only for some datasets, it is impossible to say
how much space the ratio actually covers.  Fix this by introducing
dedupused/dedupsaved pool properties, similar to earlier added
block cloning ones.  Combined with work to expose allocation classes
stats, it should give user-space enough visibility to correlate
`zpool list` and `zfs list` space numbers.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Ryan Moeller <ryan.moeller@klarasystems.com>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#18245
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants