Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running Ubuntu 13.10 with an LSI 9211-8i SAS adapter with Samsung 840 EVO SSDs. Doing some performance testing I noticed the write speed dropping off significantly so I've been attempting to get TRIM working with this adapter. The SSDs support TRIM:

# hdparm -I /dev/sdc | grep "TRIM supported"
    *   Data Set Management TRIM supported (limit 8 blocks)

If I move the SSDs to another system with a different controller, run fstrim and move them back to this system the expected performance is restored.

According to LSI their initiator-target (IT) firmwares support trim. However trim support is not working:

# cat /sys/block/sdc/queue/discard_granularity 
0

# fstrim /srv/node/disk2p1
fstrim: /srv/node/disk2p1: FITRIM ioctl failed: Operation not supported

I am not using LVM or crypto for these file systems. I've tried both xfs and ufs4 formats, although I am planning on using xfs. Here is an example fstab line:

LABEL=disk2p1 /srv/node/disk2p1 xfs noatime,nodiratime,nobarrier,logbufs=8,discard 0 0

For the controller firmware I've tried LSI's P14, P16 and P18 (latest) firmwares. I've also built the LSI provided mpt2sas driver P18 which required a minor patch to remove __devexit but otherwise compiled and runs okay. I also tried a daily snapshot build of Trusty using the stock mpt2sas driver.

Here are the mpt2sas dmesg lines with the time removed:

mpt2sas version 18.00.00.00 loaded
mpt2sas0: 64 BIT PCI BUS DMA ADDRESSING SUPPORTED, total mem (16418600 kB)
mpt2sas0: _base_get_ioc_facts: IOC_STATE(0x22000000)
sd 3:0:0:0: [sda] 7815168 512-byte logical blocks: (4.00 GB/3.72 GiB)
sd 3:0:0:0: [sda] Write Protect is off
sd 3:0:0:0: [sda] Mode Sense: 43 00 00 00
sd 3:0:0:0: [sda] No Caching mode page found
sd 3:0:0:0: [sda] Assuming drive cache: write through
sd 3:0:0:0: [sda] No Caching mode page found
sd 3:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 3:0:0:0: [sda] No Caching mode page found
sd 3:0:0:0: [sda] Assuming drive cache: write through
sd 3:0:0:0: [sda] Attached SCSI removable disk
mpt2sas0: _base_get_ioc_facts: failed going to ready state  (ioc_state=0x20000000)
mpt2sas0: MSI-X vectors supported: 1, no of cores: 16, max_msix_vectors: -1
mpt2sas 0000:04:00.0: irq 79 for MSI/MSI-X
mpt2sas0-msix0: PCI-MSI-X enabled: IRQ 79
mpt2sas0: iomem(0x00000000df2b0000), mapped(0xffffc90011c80000), size(65536)
mpt2sas0: ioport(0x000000000000fc00), size(256)
mpt2sas0: _base_get_ioc_facts: IOC_STATE(0x22000000)
mpt2sas0: _base_get_ioc_facts: failed going to ready state  (ioc_state=0x20000000)
mpt2sas0: sending message unit reset !!
mpt2sas0: message unit reset: SUCCESS
mpt2sas0: Allocated physical memory: size(7445 kB)
mpt2sas0: Current Controller Queue Depth(3307), Max Controller Queue Depth(3432)
mpt2sas0: Scatter Gather Elements per IO(128)
mpt2sas0: overriding NVDATA EEDPTagMode setting
mpt2sas0: LSISAS2008: FWVersion(18.00.00.00), ChipRevision(0x03), BiosVersion(07.35.00.00)
mpt2sas0: Dell 6Gbps SAS HBA: Vendor(0x1000), Device(0x0072), SSVID(0x1028), SSDID(0x1F1C)
mpt2sas0: Protocol=(Initiator,Target), Capabilities=(TLR,EEDP,Snapshot Buffer,Diag Trace Buffer,Task Set Full,NCQ)
mpt2sas0: sending port enable !!
mpt2sas0: host_add: handle(0x0001), sas_addr(0x590b11c027281600), phys(8)
mpt2sas0: port enable: SUCCESS
sd 2:0:1:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 2:0:0:0: [sdb] 143374000 512-byte logical blocks: (73.4 GB/68.3 GiB)
sd 2:0:2:0: [sdd] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 2:0:3:0: [sde] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 2:0:4:0: [sdf] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: d7 00 00 08
sd 2:0:5:0: [sdg] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 2:0:1:0: [sdc] Write Protect is off
sd 2:0:1:0: [sdc] Mode Sense: 7f 00 10 08
sd 2:0:1:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 2:0:2:0: [sdd] Write Protect is off
sd 2:0:2:0: [sdd] Mode Sense: 7f 00 10 08
sd 2:0:2:0: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 2:0:3:0: [sde] Write Protect is off
sd 2:0:3:0: [sde] Mode Sense: 7f 00 10 08
sd 2:0:3:0: [sde] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 2:0:4:0: [sdf] Write Protect is off
sd 2:0:4:0: [sdf] Mode Sense: 7f 00 10 08
sd 2:0:4:0: [sdf] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 2:0:5:0: [sdg] Write Protect is off
sd 2:0:5:0: [sdg] Mode Sense: 7f 00 10 08
sd 2:0:5:0: [sdg] Write cache: enabled, read cache: enabled, supports DPO and FUA

Is it just that mpt2sas doesn't support TRIM (SAS UNMAP)? Could someone recommend a working controller for a rack-mounted system or JBOD if this one doesn't support it? I need between 8 - 16 SATA SSDs (non-RAID configuration) in a rack-mounted system or JBOD combined with a controller that supports TRIM.

share|improve this question
    
I've run into the same issue you have. I tried IT and IR firmware, and same problem. I tried moving the EVO drives to an Intel C602 SAS controller. Unfortunately, now they only link at SATA-II (3Gbps) speed, BUT TRIM works. It uses the isci driver. BTW, if you get to trying to run the EVO drives with Linux software RAID, it should work find with RAID 0 and RAID 1 (with discard/TRIM support). EVO drives will NOT work with RAID5/6, since RAID5/6 code requires that the SSDs return zeros after TRIM, which the EVOs do NOT. Also, contrary to what LVM might lead you to believe, it also does NOT suppo –  THardie Mar 24 at 23:47
    
Right. The Samsung 840 EVO's support TRIM on other controllers, however not with LSI controllers. Presumably because they don't support deterministic read after trim and the controller disables support. The Samsung 840 Pro SSD's do work the the LSI controllers. –  Kurt M Mar 26 at 20:48

1 Answer 1

up vote 4 down vote accepted
+200

I received some help on the linux-scsi list where it was suggested that for trim to work with LSI controllers, deterministic read after trim (read zero) is needed. I switched to the Samsung Pro SSD's. They do have deterministic read after trim and work correctly with LSI controllers. So mpt2sas does support TRIM when deterministic read after trim is supported on the SSD.

Also, I found the LSI compatibility List where you can check if an SSD is supported. This list currently is updated somewhat frequently.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.