Bug 36722 - TRIM support is broken for Crucial M4 drives
Summary: TRIM support is broken for Crucial M4 drives
Status: RESOLVED DOCUMENTED
Alias: None
Product: File System
Classification: Unclassified
Component: ext4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_ext4@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-05 15:05 UTC by devsk
Modified: 2012-08-24 13:01 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.38.8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg output (70.08 KB, text/x-log)
2011-06-05 15:05 UTC, devsk
Details
BLKDISCARD testing program (752 bytes, text/x-csrc)
2011-06-06 09:04 UTC, Lukas Czerner
Details

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

Note You need to log in before you can comment on or make changes to this bug.