# Ext4 and Discard option (TRIM)

## Zarhan

I recently upgraded to X-25 G2 SSD drive from Intel. I've been running ext4. Now, the kernel docs state that

```
discard         Controls whether ext4 should issue discard/TRIM

nodiscard(*)            commands to the underlying block device when

                        blocks are freed.  This is useful for SSD devices

                        and sparse/thinly-provisioned LUNs, but it is off

                        by default until sufficient testing has been done.

```

...sooo, in practice, what does this mean? This is talking about a *filesystem* and I'd sure prefer that I wouldn't get data loss or anything like that, but how "experimental" is this still? What tests have been done and what's the verdict? Should I wait for 2.6.35 or even beyond before setting that option?

----------

## ssteinberg

Not using an SSD myself yet on home's machine so I can only report what I researched.

TRIM marks an erase block on the SSD as unused (aka free) by the fs. Meaning the next time a write operation takes place on this block the SSD can write without the read->erase->write performance penalty. This is also especially useful for Intel's SSD.

Apparently the TRIM code that comes with the 2.6.34 kernel is still highly unoptimized. Seems like 2.6.35 works well.

----------

## Zarhan

Yeah, I know what TRIM means, but ok, I'll wait for 2.6.35 before turning it on then.

----------

