Feature #1701


ZFS to support UNMAP/TRIM for SSD

Added by Alexander Stetsenko over 12 years ago. Updated over 4 years ago.

zfs - Zettabyte File System
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:
External Bug:


zfs shoud support SCSI UNMAP / SATA TRIM commands for SSD

Related issues

Related to illumos gate - Bug #6363: Add UNMAP/TRIM functionality to ZFS and IllumosClosedJerry Jelinek2015-10-20

Related to illumos gate - Bug #11714: temporarily disable ZFS TRIM supportClosedJerry Jelinek

Actions #1

Updated by Albert Lee about 6 years ago

  • Related to Bug #6363: Add UNMAP/TRIM functionality to ZFS and Illumos added
Actions #2

Updated by Jerry Jelinek over 4 years ago

  • Category changed from kernel to zfs - Zettabyte File System
  • Status changed from New to In Progress
  • Assignee changed from Alexander Stetsenko to Jerry Jelinek

I'll close out #6363 since that duplicates this issue which predates it.

I've ported the ZFS TRIM support from ZoL. This includes the following related commits:
1b939560be Add TRIM support
e55db32ad0 zpool: trim -p is not a valid option
dd785b5b86 Fix vdev_initialize_restart / removal race
96ebc5a1a4 Fix race in vdev_initialize_thread
a769fb53a1 Add 'zpool status -i' option
c10d37dd9f zfs initialize performance enhancements

Actions #3

Updated by Jerry Jelinek over 4 years ago

To test this I ran the zfs-test suite, which includes new tests for TRIM, on both DEBUG and non-DEBUG builds. The new TRIM tests require at least one trimmable SSD as one of the disks to be used for the test run. I ran this on both a system which had a trimmable SSD I could use, and one which did not. The TRIM tests are properly skipped when there is no SSD in the test configuration. The new TRIM tests all pass on the configuration with a trimmable SSD.

Actions #4

Updated by Electric Monk over 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 084fd14f7c3336eb67ee283cabad2da8998b00d6

commit  084fd14f7c3336eb67ee283cabad2da8998b00d6
Author: Brian Behlendorf <>
Date:   2019-09-10T16:28:15.000Z

    1701 ZFS to support UNMAP/TRIM for SSD
    Portions contributed by: Jerry Jelinek <>
    Portions contributed by: George Wilson <>
    Portions contributed by: Saso Kiselkov <>
    Portions contributed by: Tim Chase <>
    Portions contributed by: Chunwei Chen <>
    Reviewed by: Matt Ahrens <>
    Reviewed by: loli10K <>
    Reviewed by: Tim Chase <>
    Reviewed by: George Wilson <>
    Reviewed by: Richard Elling <>
    Reviewed by: Tom Caputi <>
    Reviewed by: Jorgen Lundman <>
    Reviewed by: Serapheim Dimitropoulos <>
    Reviewed by: C Fraire <>
    Reviewed by: Kody Kantor <>
    Approved by: Dan McDonald <>

Actions #5

Updated by Marcel Telka over 4 years ago

  • Related to Bug #11714: temporarily disable ZFS TRIM support added

Also available in: Atom PDF