My experience with My Macbook Pro (late 2009) model identifier "MacBookPro5,4"; boot rom version MBP53.00AC.B03 is as follows:
I purchased this mackbook pro on 8/12/2009. Before powering it on, I installed a working Intel X25M 80Gb SSD (G1 model, not G2) which was previously installed in a Sony Vaio laptop, which worked great. Late Thursday evening, I started to install Leopard on it, not realizing that the configuration was flawed. Installing leopard took so long, that I left it and went to bed. It had completed by Friday morning, so I started the application install, which took most of Friday. The problem with the lengthy time was, of course, a problem that has been explained here in other posts. Over the weekend, I remembered that Apple had ported in the Dtrace utility from Solaris, and I worked on discovering why certain processes simply stopped (Sympton: color wheel). A simple dtrace script like:
Sorry about the In the following code, the square-brackets around probefunc seem to be removed
when I preview the code, so put those in if you don't see them.
#!/usr/sbin/dtrace
syscall:::entry
/pid == $target/
{
ts\[probefunc\] = timestamp;
}
syscall:::return
{
@observations\[probefunc\] = max(timestamp - ts\[probefunc\])
}
allows the superuser to determine what system calls take the longest period of time (all times listed in nanoseconds). Using a command like:
dtrace -s longest-syscalls.d -c "dd if=dtrace.pdf of=dtrace.samp"
Dtrace.pdf is a file, about 2.5Mbytes in size.
My investigations showed that the longest times were taken by the system's "write()" call. On my current (and original equipment disk), this takes 95495 nanoseconds, which is about what I would expect. Although I no longer have the figures when the SSD was installed, it was upwards of 20 seconds. (i.e. 20,000,000,000 nanoseconds).
While googling around for the answer to this problem, I found two things;
1) On Linux systems, NCQ queues were limited to 0x1F (31) entries. In the comments I saw, this was due to some problem in the protocol.
2) In Germany, there were problems reported between nVidia chipsets and SATA drives related to enabling NCQ.
The further investigation I have done today shows that the SATA driver for OS X is located in the file /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorag e.kext/Contents/MacOS/IOAHCIBlockStorage
At least I'm think it is. Now, using a very old technique, and the command line utility "strings", you can extract all of the strings from this binary file. You can then grep through them for ones containing NCQ. Here's the results of that grep on my system:
AHCI Port NCQ
disabling NCQ ... controller does not support it!
disabling NCQ ... drive does not support it!
disabling NCQ ... user boot-arg requested it!
NCQ support survived all obstacles ... will be enabled!
AHCI: non-NCQ error... trigger resend.
NCQ error state caused by queued command = %d
NCQ error state caused by non-queued command
So, it appears that on some Macs, there is a method using the boot-args to disable NCQ. Otherwise there wouldn't be a need for a string saying that was why it was disabled. The question now, is how to do this on a (late 2009) Macbook Pro? I will contact Apple in the morning to see if they know how.
In the meantime, the utility /usr/bin/otool can be used to disassemble the code in the file using a command like:
otool -tvV IOAHCIBlockStorage
The extracted assembly is unfortunately difficult to understand without access to the header files that define the classes that are being used.
If you have the development tools installed (I think these are called Xcode sometimes), you can use a program they supply called IORegistryExplorer. Starting this up, and then typing 'AHCI' in the search box, you can find the AHCI entry which on my computer reads AppleMCP79AHCI. 3 lines below that, you will see an entry named 'AppleAHCIDiskDriver'. If you select that, in the right-hand pane, you will see "NCQ Boolean True", and "Queue Depth Number 0x20".
Now, while I have not yet figured out how to modify these values, it may be that setting NCQ to false; or Queue Depth to (0 or 1 or 0x1f) might make things work. Or perhaps disabling NCQ from the boot arguments might work too.