Technology card
ShippingTRIM / Discard
TRIM · discard · deallocate · Dataset Management
Filesystem hygiene for flash—not a secure erase by itself, but essential for steady-state SSD performance.
Related
On this page6 sections
In one minute
TRIM (ATA) and discard/deallocate (NVMe) are host hints that logical blocks are no longer in use. The OS sends ranges after file deletes or volume operations; the SSD (or SMR drive with support) may mark those LBAs free so garbage collection can erase NAND pages sooner. Commands are advisory—behavior depends on controller firmware and feature bits.
Deleting a file only updates the filesystem journal. The SSD still believes those LBAs are valid until the OS sends a discard. TRIM is that courtesy call: these logical addresses are free; you may erase the underlying pages when convenient.
On SATA you will see DATA SET MANAGEMENT flow through the AHCI driver; on NVMe it is Dataset Management opcode 09h with AD=1. Same intent, different packet shapes—both documented in the NVMe and ATA worlds linked from the SSD and SATA cards.
Enable periodic discard on client SSDs; understand that TRIM assists garbage collection, not compliance wiping. For crypto erase or sanitize, use the explicit secure-erase commands vendors document separately.
Revision 1.0c, dated October 3rd, 2022, shows a maximum case of 256 ranges in Figure 41, Range 0 through Range 255, with Range 255's Starting LBA at bytes 4095:4088. Number of Ranges (NR), Command Dword 10 bits 07:00, is a 0's-based count of 16 byte range sets, and the length in logical blocks field is 1-based. If the controller reports a non-zero Dataset Management Ranges Limit (DMRL), it does not process attributes or context attributes for any range number greater than or equal to that value. A non-zero Dataset Management Range Size Limit (DMRSL) means the controller does not process attributes or context attributes for a logical block whose LBA offset from the starting LBA of the range is greater than or equal to that value. A non-zero Dataset Management Size Limit (DMSL) is a processing limit on the total number of logical blocks for the command. DMRL, DMRSL, and DMSL are all non-zero or all 0h. An unused DMRL set to all bits 1 still leaves 255 of the 256 ranges, because DMRL is 1-based and NR is 0's-based. Section 3.2.3.1.1 prints DMRL 1 or 2, DMSL 1,048, range 0 of 1,024 logical blocks, range 1 of 512 logical blocks, and the first 24 logical blocks of range 1 only as an example, and only when ONCS bit 2 is 1 and DMRSL is at its maximum. When the Deallocated or Unwritten Logical Block error is not enabled, a read is all bytes 0h if DLFEAT bits 2:0 are 001b, all bytes FFh if they are 010b, or either all 0h or all FFh if they are 000b, and that value stays the same until a write. [trim-nvme-nvm-cmdset]
Compared to neighbors
HM-SMR needs zone semantics beyond discard. HDDs without flash ignore TRIM unless they implement device-managed SMR behaviors. Write Zeroes with deallocate bit is a related NVMe path.
Uncertainty notes
- No firstSeen date — TRIM adoption spanned Windows 7 era, Linux 2.6.33+, and ACS standard revisions; not collapsed here.
- Wikipedia and Rossmann articles are secondary summaries; NVMe spec and Microsoft Learn carry normative deallocate behavior.
Sources
- 01NVM Express NVM Command Set Specification, Revision 1.0c, October 3rd, 2022, sections 3.2.3.1 and 3.2.3.2.1 · accessed 2026-10-28
- 02Microsoft Learn — NVME_CDW11_DATASET_MANAGEMENT (AD deallocate bit) · accessed 2026-10-06
- 03Wikipedia — Trim (computing) (ATA DSM and NVMe mapping overview) · accessed 2026-10-06
- 04INCITS T13 — AT Attachment standards (ATA command set home) · accessed 2026-10-06
- 05nvme-dsm(1) — Linux manual page for NVMe Dataset Management · accessed 2026-10-06
- 06Rossmann Group — ATA DSM vs NVMe deallocate (technical reference) · accessed 2026-10-06