Re: about TRIM/DISCARD support and barriers

From: David Woodhouse
Date: Sun Nov 23 2008 - 08:40:07 EST


On Sun, 2008-11-23 at 05:35 -0700, Matthew Wilcox wrote:
> The current VFAT filesystem implements DISCARD.

As does btrfs. I think I posted ext2 patches a little while ago too? Or
someone else did. Did they get merged?

> Here's the patch I've
> been testing -- it's not right; it causes SSDs from two different vendors
> to hang. I'm waiting for a free slot on the SATA protocol analyser to
> figure out what's we're doing wrong.
>
> Note that the SCSI UNMAP command does not yet have an official number,
> so this patch cannot yet be applied (... how much longer until ATA is no
> longer part of SCSI?)
>
> We don't attempt to put non-contiguous ranges into a single TRIM yet.

We don't even merge contiguous ranges -- I still need to fix the
elevators to stop writes crossing writes, before we can stop discards
from also being barriers. (Discards are just writes, for the purpose of
that conversation).

> We currently assume all SCSI devices support UNMAP instead of checking
> the feature flag (because last time I looked, I couldn't tell what flag
> I was supposed to check). Once we do that, I need to set that flag in
> libata-scsi depending on the support for the TRIM bit in the identify
> command.

The code in drivers/ide does check the feature, although I'm not 100%
sure I got that part right.

--
David Woodhouse Open Source Technology Centre
David.Woodhouse@xxxxxxxxx Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/