Forcing AHCI To Increase Intel X25-M Performance

| Comments

The BIOS in my Dell Inspiron 6400 does not allow me to set the ICH7 SATA controller to AHCI mode. I grabbed a fresh copy of the Linux 2.6.31 kernel source and applied this AHCI quirks patch to it. I copied the Ubuntu /boot/config-2.6.28-15-generic to the new source directory and ran a make oldconfig.

With the stock Ubuntu 2.6.28-15-generic amd64 kernel, dmesg showed that the controller was using the ata_piix driver and NCQ was disabled:

[    1.696401] scsi0 : ata_piix
[    1.696594] scsi1 : ata_piix
[    1.860550] ata1.00: 156301488 sectors, multi 8: LBA48 NCQ (depth 0/32)

With the 2.6.31 kernel with the patch applied, dmesg showed:

[    1.918218] scsi0 : ahci
[    1.918414] scsi1 : ahci
[    2.400540] ata1.00: 156301488 sectors, multi 8: LBA48 NCQ (depth 31/32)

This is definitely an improvement, so I ran another quick dd to see if there was a change:

root@zaphod:~# dd if=/dev/sda2 of=/dev/null bs=2M count=500
500+0 records in
500+0 records out
1048576000 bytes (1.0 GB) copied, 8.45229 s, 124 MB/s

That was definitely an improvement so I thought it was time to run bonnie++ again:

Version 1.03c                     ------Sequential Output------ --Sequential Input- --Random-
                                  -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine                      Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
2.6.31 ahci deadline        6528M 45836  96 74973  15 36691  10 43531  78 139407  17 13431  39
2.6.28 piix deadline        6464M 48265  96 81809  23 37340  11 36500  70 108486  18  5502  12
2.6.28 piix cfq             6464M 47577  96 82931  21 38706  11 46920  91 116400  20  4482  26

Enabling AHCI and NCQ gave me a small decrease in sequential output performance, a very nice increase in sequential input performance, and an insane increase in seeks per second. I can only assume that the seeks per second was helped so tremendously by NCQ.

So far I have found to major issues with using this kernel patch—the laptop won't resume from a suspend and my optical drive has disappeared. From what I can tell, these two problems vary by machine.

On an unrelated note, my Wi-Fi (iwl3945) connects much faster with 2.6.31 than it did with 2.6.28.