![mpt2sas 驱动程序是否支持 TRIM?](https://linux22.com/image/1045160/mpt2sas%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E6%94%AF%E6%8C%81%20TRIM%EF%BC%9F.png)
我正在运行 Ubuntu 13.10,它带有 LSI 9211-8i SAS 适配器和三星 840 EVO SSD。在进行一些性能测试时,我注意到写入速度明显下降,因此我一直在尝试让 TRIM 使用此适配器工作。SSD 支持 TRIM:
# hdparm -I /dev/sdc | grep "TRIM supported"
* Data Set Management TRIM supported (limit 8 blocks)
如果我将 SSD 移至具有不同控制器的另一个系统,运行 fstrim 并将其移回此系统,则预期性能就会恢复。
据 LSI 称,其启动器-目标 (IT) 固件支持修剪。但是 trim 支持不起作用:
# cat /sys/block/sdc/queue/discard_granularity
0
# fstrim /srv/node/disk2p1
fstrim: /srv/node/disk2p1: FITRIM ioctl failed: Operation not supported
我是不是对这些文件系统使用 LVM 或 crypto。我尝试过 xfs 和 ufs4 格式,但我打算使用 xfs。以下是 fstab 行示例:
LABEL=disk2p1 /srv/node/disk2p1 xfs noatime,nodiratime,nobarrier,logbufs=8,discard 0 0
对于控制器固件,我尝试了 LSI 的 P14、P16 和 P18(最新)固件。我还构建了 LSI 提供的 mpt2sas 驱动程序 P18,该驱动程序需要一个小补丁来删除 __devexit,但除此之外编译并运行正常。我还尝试使用库存 mpt2sas 驱动程序对 Trusty 进行每日快照构建。
以下是删除了时间的 mpt2sas dmesg 行:
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
是不是因为 mpt2sas 不支持 TRIM(SAS UNMAP)?如果这个不支持,有人能推荐一个适用于机架式系统或 JBOD 的控制器吗?我需要机架式系统或 JBOD 中的 8 - 16 个 SATA SSD(非 RAID 配置)以及支持 TRIM 的控制器。