cancel
Showing results for 
Search instead for 
Did you mean: 

Trim available in IDE and AHCI?

idata
Esteemed Contributor III

After reading so many confusing posts about having TRIM...I am still wonder whether TRIM will still pass the command through IDE. 1/2 the people in forums says yes, and 1/2 the says no. I am still in IDE mode and never used AHCI. I thought TRIM was working until lurking in many forums. My performance never degraded so far using X25-M G2 02HA...still the same benchmark since the first TRIM firmware. Someone chime on this to whether I should enable AHCI.

10 REPLIES 10

idata
Esteemed Contributor III

@Jan Derk

CrystalDiskMark is an artificial benchmark and is unfortunately no scientific proof of anything. See this interesting article by OCZ: http://www.ocztechnology.com/res_old/images/Configuring-and-Setting-Up-SSDs.pdf http://www.ocztechnology.com/res_old/images/Configuring-and-Setting-Up-SSDs.pdf

idata
Esteemed Contributor III

The benchmarks shown by Jan Derk are completely invalid. All one has to do is look at the title bars and chuckle. Come on folks...

So many consumers aren't familiar with what "IDE" and "AHCI" actually represent and what they do. Becoming familiar with the current working draft ATA-8 ACS-2 specification as well as with the Intel AHCI specifications (all versions) would really be the best choice here. I'll get to TRIM near the end of this.

"IDE mode" is simply too vague; there are actually 3 separate modes that you can use, but some BIOS vendors choose to label them ambiguously (as "IDE") so it's impossible to tell which of the two they use. Decent boards have 3 choices: either Compatibility, Enhanced, or AHCI (and for RAID-capable southbridges, a RAID option as well. If the SB has RAID and AHCI capability, choosing RAID also enables AHCI, but not vice-versa). This advice applies to SSDs as well as mechanical HDDs, just for the record.

"Compatibility" means that your SATA-attached device is "emulated" as a classic IDE/PATA device through the southbridge itself. The SB does some form of translation to basically make your drive appear as a classic PATA disk. You are therefore limited to classic ATA/PATA bus speeds and the horrors of DMA/UDMA/WDMA and the numerous UDMA (ATA-xxx) modes, plus Master/Slave and classic IRQ ordeals (14/15). The disk literally shows up on a classic IDE/ATA bus as a Master, under IRQ 14 in most cases. Some controllers in this mode run at ATA-100, others at ATA-133. So, right there you can see that you've actually got extra overhead and a lot of annoyance. Why would someone choose this mode? Pure classic compatibility: some classic operating systems do not function quite right with "Enhanced" mode, nor with AHCI, so this literally makes the SATA disk appear as a classic IDE/PATA device (intended for operating systems which do not have SATA capability/drivers). Got it?

"Enhanced" just turns on two "extra" options for southbridge capability: AHCI (on/off) or RAID (assuming its available on your southbridge) (on/off). It's just an added menu structure. If "Enhanced" is chosen and AHCI is left off and RAID is left off, the controller operates in somewhat of an interesting state. Usually DOS works, indicating portions of the legacy I/O framework are actually emulated via PCI/PCIe BARs, but there is absolutely no AHCI or RAID option ROM in use here. So in a way it's "like" "Compatibility", but provides more tie-ins to OSes which support SATA natively and know how to interface with a SATA-capable southbridge that sits on the PCI/PCIe bus. DOS obviously doesn't know how to speak to SATA controllers via PCI, but somehow DOS still works in this mode -- so there's definitely some emulation made available for OSes which use it.

In general I tell people that if they aren't 100% certain their OS natively supports AHCI or has AHCI drivers slipstreamed (e.g. XP), to go with "Enhanced". Your BIOS doesn't have "Enhanced" but has "IDE"? Well, who knows what that means (see 5th-to-last paragraph below).

"AHCI", on the other hand, is a completely new and greatly improved communication protocol between a storage controller (southbridge in this case) and a disk. It has a significantly large number of benefits compared to classic PATA, and provides performance benefits because of the fact that the AHCI capability provides numerous features on the PCI/PCIe bus that don't exist with classic controllers -- all while establishing a *standard* protocol that can be used (e.g. no more vendor-specific drivers; anyone can do AHCI). It's important to understand that AHCI is a technology that allows the operating system and the storage controller to communicate better; it is not the protocol that is spoken between the storage controller and the disk. Got it?

Things AHCI offers includes hardware-level NCQ capability, hot-swapping (you can do this without AHCI but the OS will often get quite angry (possibly bluescreen in Windows) or will have to have extra code in the driver to deal with timeouts), support for 64-bit LBA addressing (we're at 48-bit right now but these 3TB and larger disks are going to need 64-bit soon enough -- and do not confuse 64-bit LBA with "64-bit operating systems" or a "64-bit OS" -- those are unrelated things), full/complete removal of the master/slave device concept, power management like DIPM (mainly laptop folks care about this), and support for port multipliers (look them up if you want to know what they are). The short, non-technical explanation is that the protocol is well-written and extremely robust while providing a universal standard and capability to grow. The protocol IS NOT "hairy" or disgusting like classic IDE/PATA is; it's actually quite elegant on present-day hardware.

Because nobody seems to believe in being consistent, different motherboard manufacturers tend to name these options completely bizarre and vague things. I've seen "Compatibility", "Emulated", "Classic", "Normal", and even "Dedicated". The manuals usually never state what these actually correlate with or what they do to the southbridge.

So, "IDE" in the case of the OP could actually mean "Compatibility" or "Emulated", which could definitely explain lesser performance. It all depends on what the term actually means with regards to the southbridge, and the only people who can tell you that is the motherboard manufacturer (who also controls/defines what the BIOS does). So there you go.

I hope this sheds some light on the whole "IDE vs. AHCI, what the heck?" debacle. Sorry, I just grow tired of seeing folsk who don't understand the difference. It helps if you actually use and interface with storage subsystems on a lower level, but it's also important to learn how things work before you talk about them. For example I know jack squat about cars, so I don't talk about them; I let car folks do the talking. 🙂

Finally, about TRIM. Do you need AHCI to get TRIM support? The straight up factual 100% accurate answer is NO, YOU DO NOT. TRIM is an actual ATA protocol command (see above, re: ATA-8 ACS-2), specifically DATA SET MANAGEMENT command 0x06. If you want to read about it, please see the ATA-8 ACS-2 working draft document, section 7 "Command Descriptions" subsection 10. Any device that speaks the ATA protocol -- such as SATA hard disks -- and supports 48-bit LBA addressing, can support the TRIM command. You can submit this command to the drive via a standard ATA CDB message and it will work. You DO NOT need AHCI to send this command. And of course there's a similar status/capability bit that defines if the device (disk) has TRIM capability or not.

So what sends the TRIM command? Simple: the operating system or software that is speaking to the disk. Windows 7, for example, does it. Linux can do it. FreeBSD can do it (but currently only for UFS/UFS2 filesystems; TRIM is not supported in ZFS). For those of us on Windows XP, the OS cannot, so we use utilities like Intel's SSD Toolbox to do it either manually or via scheduled events.

Are we clear? 🙂

idata
Esteemed Contributor III

KOITSU - Best, most thorough and knowledgeable reply I've seen! Thank you very much. Let me know if you need helsp with your car

idata
Esteemed Contributor III

BDS73 wrote:

Trim will work in either mode (IDE or AHCI) for XP or Vista through the Intel SSD Toolbox. Win7 will currently require MSAHCI driver to run trim. The larger question is why would you want to ever run in IDE mode with an Intel SSD??? In IDE mode you loose Native Command Queuing which can severaly impact drive performance. You also loose DIPM (Device Initiated Power Management) support in IDE mode which will result in lower overall battery life.

CrystalDiskMark does not support queue depths larger than one. Therefore if you are trying to compare performance between IDE and AHCI mode you are not going to see much of any difference. CrystalDiskMark is not the best tool for evaluating performance of a drive such as the Intel SSD that implements very heavy queuing.

What tool is in your opinion more suitable for evaluating a SSD?

idata
Esteemed Contributor III

Not all of us have a BIOS with AHCI. I'm running my G2 160Gb in a Sony VAIO NW laptop and the BIOS is locked, I'll never get AHCI for my NW series unless Sony releases an update.