Intel X25-M G2 Upgrade, and a Lack of AHCI

| Comments

My shiny new 80 GB second-generation Intel X25-M has arrived.  So far I am very happy with it, and it is very fast.  I don't have many real numbers yet, just a couple of bonnie++ benchmarks:

    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     cfq           6464M 47577  96 82931  21 38706  11 46920  91 116400  20  4482  26     deadline      6464M 48265  96 81809  23 37340  11 36500  70 108486  18  5502  12

    xenhost       1080M 68909  97 128789  45 48402  18 55770  91 106948  24 326.2   0

The first two entries are my laptop with the cfq and deadline schedulers. The third entry is an old benchmark of the server hosting all my Xen virtual machines.  It is running Linux software RAID 10 on four 400 GB 7200 RPM SATA disks.

At first glance I was pretty happy with how well the X25 kept up with the RAID 10, and the numbers certainly beat my old laptop disk by a huge margin.  I was especially happy with the 4500-5500 random seeks per second. The numbers seemed a bit low to me, though. So I tried a simpler test:

    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, 10.5582 s, 99.3 MB/s

All my simple tests with dd are pegged out at around 100 MB/sec.  After doing some research, I learned that the BIOS in my laptop is setting my ICH7 chipset to compatibility mode.  This is limiting the drive to UDMA/133 speeds, which probably puts a real world upper limit in the 100MB/sec range.

The BIOS in my Dell Inspiron 6400 does not let me change the mode of the ICH7.  There seems to be at least one kernel patch that attempts to enable AHCI after boot up.  I might give it a try in the next few days and see what the numbers look like.

This has still been a huge performance increase over my 120 GB, 7200 RPM laptop drive, even without being able to use the full potential of the X25.  My unscientific "one-hippopotamus, two-hippopotamus" boot-up test easily comes in at under 10 seconds from grub to login screen (I'm running Ubuntu 9.04).  I am pretty certain that the old drive was in the 15-16 second range.  I'll have to boot the old disk, use a stopwatch, and run some benchmarks later in the week.

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 two 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.

Comments