linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* TRIM support in drivers and dm/md?
@ 2010-11-04 13:19 Jeff Layton
  2010-11-04 13:40 ` Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Layton @ 2010-11-04 13:19 UTC (permalink / raw)
  To: linux-fsdevel

  Good morning,

Do many of the SATA controllers support TRIM? (i.e. pass
the TRIM command to the SSD). Does anyone know
anything about dm/md supporting TRIM? (I'm thinking LVM
and software RAID tools).

Thanks!

Jeff


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: TRIM support in drivers and dm/md?
  2010-11-04 13:19 TRIM support in drivers and dm/md? Jeff Layton
@ 2010-11-04 13:40 ` Matthew Wilcox
  2010-11-04 14:46   ` Jeff Layton
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2010-11-04 13:40 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-fsdevel

On Thu, Nov 04, 2010 at 09:19:43AM -0400, Jeff Layton wrote:
> Do many of the SATA controllers support TRIM? (i.e. pass
> the TRIM command to the SSD). Does anyone know
> anything about dm/md supporting TRIM? (I'm thinking LVM
> and software RAID tools).

As far as I know, there's nothing to be done in any SATA controller
driver to support TRIM.  It's just up to the drive whether it understands
the command.

Not sure what the sate of play is with MD/DM and TRIM.  It's a bit tricky
because some SATA drives will return different garbage from TRIMmed sectors
each time they're read.  That can hamper a RAID-5/6 rebuild "somewhat".

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: TRIM support in drivers and dm/md?
  2010-11-04 13:40 ` Matthew Wilcox
@ 2010-11-04 14:46   ` Jeff Layton
  2010-11-04 16:45     ` Jeff Garzik
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Layton @ 2010-11-04 14:46 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-fsdevel

  On 11/04/2010 09:40 AM, Matthew Wilcox wrote:
> On Thu, Nov 04, 2010 at 09:19:43AM -0400, Jeff Layton wrote:
>> Do many of the SATA controllers support TRIM? (i.e. pass
>> the TRIM command to the SSD). Does anyone know
>> anything about dm/md supporting TRIM? (I'm thinking LVM
>> and software RAID tools).
> As far as I know, there's nothing to be done in any SATA controller
> driver to support TRIM.  It's just up to the drive whether it understands
> the command.
That's the rub. I've heard that many drivers don't understand
the command. So I'm curious what drivers do and any experience
anyone might have.

Thanks!


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: TRIM support in drivers and dm/md?
  2010-11-04 14:46   ` Jeff Layton
@ 2010-11-04 16:45     ` Jeff Garzik
  2010-11-04 17:56       ` Jeff Layton
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2010-11-04 16:45 UTC (permalink / raw)
  To: Jeff Layton; +Cc: Matthew Wilcox, linux-fsdevel

On 11/04/2010 10:46 AM, Jeff Layton wrote:
> On 11/04/2010 09:40 AM, Matthew Wilcox wrote:
>> On Thu, Nov 04, 2010 at 09:19:43AM -0400, Jeff Layton wrote:
>>> Do many of the SATA controllers support TRIM? (i.e. pass
>>> the TRIM command to the SSD). Does anyone know
>>> anything about dm/md supporting TRIM? (I'm thinking LVM
>>> and software RAID tools).

>> As far as I know, there's nothing to be done in any SATA controller
>> driver to support TRIM. It's just up to the drive whether it understands
>> the command.

> That's the rub. I've heard that many drivers don't understand
> the command. So I'm curious what drivers do and any experience
> anyone might have.

Note the distinction between "drive" and "driver"...  I agree with what 
Matthew says.

	Jeff




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: TRIM support in drivers and dm/md?
  2010-11-04 16:45     ` Jeff Garzik
@ 2010-11-04 17:56       ` Jeff Layton
  2010-11-04 20:23         ` Jeff Garzik
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Layton @ 2010-11-04 17:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Matthew Wilcox, linux-fsdevel


>>>> Do many of the SATA controllers support TRIM? (i.e. pass
>>>> the TRIM command to the SSD). Does anyone know
>>>> anything about dm/md supporting TRIM? (I'm thinking LVM
>>>> and software RAID tools).
>
>>> As far as I know, there's nothing to be done in any SATA controller
>>> driver to support TRIM. It's just up to the drive whether it 
>>> understands
>>> the command.
>
>> That's the rub. I've heard that many drivers don't understand
>> the command. So I'm curious what drivers do and any experience
>> anyone might have.
>
> Note the distinction between "drive" and "driver"...  I agree with 
> what Matthew says.
>

Oops - sorry I missed "drive" vs. "driver".

I've heard from other places that drivers need to pass along
the TRIM command to the drives but that many drivers don't
do this. I assume that the best way to determine if this is
accurate is to test the controller drivers or ping the maintainers.

Thanks!


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: TRIM support in drivers and dm/md?
  2010-11-04 17:56       ` Jeff Layton
@ 2010-11-04 20:23         ` Jeff Garzik
  2010-11-05  2:44           ` Mark Lord
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2010-11-04 20:23 UTC (permalink / raw)
  To: Jeff Layton; +Cc: Matthew Wilcox, linux-fsdevel, Linux IDE mailing list

On 11/04/2010 01:56 PM, Jeff Layton wrote:
>
>>>>> Do many of the SATA controllers support TRIM? (i.e. pass
>>>>> the TRIM command to the SSD). Does anyone know
>>>>> anything about dm/md supporting TRIM? (I'm thinking LVM
>>>>> and software RAID tools).
>>
>>>> As far as I know, there's nothing to be done in any SATA controller
>>>> driver to support TRIM. It's just up to the drive whether it
>>>> understands
>>>> the command.
>>
>>> That's the rub. I've heard that many drivers don't understand
>>> the command. So I'm curious what drivers do and any experience
>>> anyone might have.
>>
>> Note the distinction between "drive" and "driver"... I agree with what
>> Matthew says.
>>
>
> Oops - sorry I missed "drive" vs. "driver".
>
> I've heard from other places that drivers need to pass along
> the TRIM command to the drives but that many drivers don't
> do this. I assume that the best way to determine if this is
> accurate is to test the controller drivers or ping the maintainers.

I'd object to the words "many" and "drivers" :)

The general rule for all kernel SATA drivers is to support all ATA 
commands, including future, unknown commands not invented yet.

That's because kernel SATA drivers deal primarily with the 
sending/receiving from hardware an opaque data bundle -- the ATA 
taskfile -- rather than create a software system that requires new code 
in each driver, for each new ATA command.

That's the ideal and, if you obtained a SATA controller in the past 5 
years or so, your controller (ahci, sata_sil24, others) supports TRIM 
just fine because it is a generic ATA taskfile transport and nothing more.

Some now-uncommon controllers have problems with new ATA commands, 
either due to (a) they are complex, firmware-driven RAID-esque beasts, 
or (b) they have an internal command table.  And I imagine some early 
SATA<->PATA bridge chips probably get confused as well.  But those are 
the minority, and getting less frequent by the day.

Note in all of the above I say "controller" rather than "driver".  I 
know of no _driver_ that prevents TRIM, where the underlying controller 
hardware supports it.

For the controllers that don't support TRIM, the error behavior should 
be something predictable and consistent like a command abort.

	Jeff



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: TRIM support in drivers and dm/md?
  2010-11-04 20:23         ` Jeff Garzik
@ 2010-11-05  2:44           ` Mark Lord
  2010-11-05  2:56             ` Jeff Garzik
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Lord @ 2010-11-05  2:44 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Jeff Layton, Matthew Wilcox, linux-fsdevel,
	Linux IDE mailing list

sata_sil didn't support trim the last time I checked (the hardware can do it 
though).
sata_sil24 does, though, along with ahci, sata_mv, etc..

Cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: TRIM support in drivers and dm/md?
  2010-11-05  2:44           ` Mark Lord
@ 2010-11-05  2:56             ` Jeff Garzik
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2010-11-05  2:56 UTC (permalink / raw)
  To: Mark Lord
  Cc: Jeff Layton, Matthew Wilcox, linux-fsdevel,
	Linux IDE mailing list

On 11/04/2010 10:44 PM, Mark Lord wrote:
> sata_sil didn't support trim the last time I checked (the hardware can
> do it though).
> sata_sil24 does, though, along with ahci, sata_mv, etc..

The recent sata_mv bugfix should be noted of course...



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-11-05  2:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-04 13:19 TRIM support in drivers and dm/md? Jeff Layton
2010-11-04 13:40 ` Matthew Wilcox
2010-11-04 14:46   ` Jeff Layton
2010-11-04 16:45     ` Jeff Garzik
2010-11-04 17:56       ` Jeff Layton
2010-11-04 20:23         ` Jeff Garzik
2010-11-05  2:44           ` Mark Lord
2010-11-05  2:56             ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).