Bug 36722

Summary: TRIM support is broken for Crucial M4 drives
Product: File System Reporter: devsk (funtoos)
Component: ext4Assignee: fs_ext4 (fs_ext4)
Status: RESOLVED DOCUMENTED    
Severity: normal CC: alan, mkp
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.38.8 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg output
BLKDISCARD testing program

Description devsk 2011-06-05 15:05:34 UTC
Created attachment 60842 [details]
dmesg output

The TRIM is disabled as per the following messages:

# dmesg | grep "discard not"
[   18.614000] EXT4-fs warning (device sdi8): release_blocks_on_commit:2674: discard not supported, disabling
[42486.763000] EXT4-fs warning (device sdi11): release_blocks_on_commit:2674: discard not supported, disabling

but TRIM support is there:

# hdparm -I /dev/sdi | grep TRIM
           *    Data Set Management TRIM supported (limit 8 blocks)
           *    Deterministic read data after TRIM

The drive is on this controller and not part of any RAID:

# lspci | grep LSI

04:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)

The dmesg is attached.

Can someone also say what this message means:

[42087.056000] EXT4-fs (sdi11): Unaligned AIO/DIO on inode 654340 by VirtualBox; performance will be poor.
Comment 1 Lukas Czerner 2011-06-06 09:04:51 UTC
Created attachment 60892 [details]
BLKDISCARD testing program

Hi,

thanks for reporting! Could you please provide the output of this simple test program ? Also the output of the following command.

grep $ /sys/block/sda/queue/discard_*

What kernel version are you using ?

Thanks!
-Lukas
Comment 2 devsk 2011-06-06 14:41:55 UTC
I am on 2.6.38.8

$ grep $ /sys/block/sdk/queue/discard_*
/sys/block/sdk/queue/discard_granularity:0
/sys/block/sdk/queue/discard_max_bytes:0
/sys/block/sdk/queue/discard_zeroes_data:0

# /tmp/discard /dev/sdk5
discard: Operation not supported

Is this because of the LSI card not passing the TRIM onto the drive? Why does hdparm report that TRIM is supported then?
Comment 3 Martin K. Petersen 2011-06-06 17:43:15 UTC
hdparm asks the drive directly whereas the LSI card must be able to translate from SCSI to ATA commands. None the LSI cards I have support that functionality yet.

You can try sending us the output of:

# sg_readcap -l /dev/sdk

# sg_vpd -p thpv /dev/sdk

-- 
Martin K. Petersen      Oracle Linux Engineering