Debian Bug report logs - #603735
libata: SSD Discard/Trim functionality does not seems to work correctly

version graph

Package: linux-2.6; Maintainer for linux-2.6 is Debian Kernel Team <debian-kernel@lists.debian.org>;

Reported by: "bs.net" <bs.net@gmx.de>

Date: Tue, 16 Nov 2010 20:03:10 UTC

Severity: normal

Found in version linux-2.6/2.6.32-27

Done: Moritz Mühlenhoff <jmm@inutil.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Kernel Team <debian-kernel@lists.debian.org>:
Bug#603735; Package linux-image-2.6.32-5-amd64. (Tue, 16 Nov 2010 20:03:12 GMT) Full text and rfc822 format available.

Acknowledgement sent to "bs.net" <bs.net@gmx.de>:
New Bug report received and forwarded. Copy sent to Debian Kernel Team <debian-kernel@lists.debian.org>. (Tue, 16 Nov 2010 20:03:13 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "bs.net" <bs.net@gmx.de>
To: submit@bugs.debian.org
Subject: libata: SSD Discard/Trim functionality does not seems to work correctly
Date: Tue, 16 Nov 2010 21:02:57 +0100
Package: linux-image-2.6.32-5-amd64
Version: 2.6.32-27

According to the linux-2.6 package changelogs ATA trim functionality were 
added with version 2.6.32-12:

linux-2.6  (2.6.32-12) unstable; urgency=low 
* The "Microwave Background" release
	...
	[ maximilian attems]
	...
	* Add libata TRIM support.
	...

It seems that the TRIM patch does not works properly with my SSD an OCZ Vertex 
2 Extended 60GB (OCZSSD2-2VTXE60G).

Generally the Trim functionality could be tested with the following commands:

dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct
hdparm --fibmap tempfile
hdparm --read-sector [ADDRESS] /dev/sdX
rm tempfile
sync
hdparm --read-sector [ADDRESS] /dev/sdX

After the last command the output should be only zero values, but I get non 
zero values:

hdparm --read-sector 26854400 /dev/sda

/dev/sda:
reading sector 26854400: succeeded
4442 4465 6cd6 5bc4 42bc f78b 9258 bf66
a024 ebca 5a8f e3f2 4886 9dea 9b50 2b45
...

I'd tried the same commands with a manually compiled 2.6.36 kernel. With this 
kernel I got zero values. It seems that there were changes in 2.6.3[3-6] 
kernels which had fixed the issue.

Furthermore
/sys/block/sda/queue/discard_zeroes_data,
/sys/block/sda/queue/discard_max_entry and
/sys/block/sda/queue/discard_granularity
are not present with 2.6.32-27, but with 2.6.36.

The discard zero indication feature were added with following commit (2.6.33 
kernel series): http://kerneltrap.org/mailarchive/git-commits-
head/2009/12/8/16006

[Max entry and granularity were annotated here: 
http://www.spinics.net/lists/linux-scsi/msg40360.html and 
http://www.spinics.net/lists/dm-devel/msg12155.html 
(http://android.git.kernel.org/?p=kernel/common.git;a=commitdiff;h=86b37281411cf1e9bc0a6b5406c45edb7bd9ea5d)]

Available should be all three attributes in 2.6.33.

Maybe this could explain the difference between 2.6.32-27 and generic kernel 
2.6.36. Eventually SandForce devices did not return zero blocks after discard 
and the ATA Trim works properly with my drive...


mount:
/dev/sda1 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,discard)
...

SSD capabilities:
hdparm -I /dev/sda
...
           *    Data Set Management TRIM supported
           *    Deterministic read data after TRIM
...

sysfs queue directory:
ls -la /sys/block/sda/queue/
insgesamt 0
drwxr-xr-x 3 root root    0 16. Nov 19:55 .
drwxr-xr-x 9 root root    0 16. Nov 19:55 ..
-r--r--r-- 1 root root 4096 16. Nov 20:49 hw_sector_size
drwxr-xr-x 2 root root    0 16. Nov 20:49 iosched
-rw-r--r-- 1 root root 4096 16. Nov 20:49 iostats
-r--r--r-- 1 root root 4096 16. Nov 20:49 logical_block_size
-r--r--r-- 1 root root 4096 16. Nov 20:49 max_hw_sectors_kb
-rw-r--r-- 1 root root 4096 16. Nov 20:49 max_sectors_kb
-r--r--r-- 1 root root 4096 16. Nov 20:49 minimum_io_size
-rw-r--r-- 1 root root 4096 16. Nov 20:49 nomerges
-rw-r--r-- 1 root root 4096 16. Nov 20:49 nr_requests
-r--r--r-- 1 root root 4096 16. Nov 20:49 optimal_io_size
-r--r--r-- 1 root root 4096 16. Nov 20:49 physical_block_size
-rw-r--r-- 1 root root 4096 16. Nov 20:49 read_ahead_kb
-rw-r--r-- 1 root root 4096 16. Nov 20:49 rotational
-rw-r--r-- 1 root root 4096 16. Nov 20:49 rq_affinity
-rw-r--r-- 1 root root 4096 16. Nov 19:55 scheduler




Bug reassigned from package 'linux-image-2.6.32-5-amd64' to 'linux-2.6'. Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Sun, 05 Jun 2011 03:51:23 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions linux-2.6/2.6.32-27. Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Sun, 05 Jun 2011 03:51:23 GMT) Full text and rfc822 format available.

Bug Marked as found in versions linux-2.6/2.6.32-27. Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Sun, 05 Jun 2011 03:51:24 GMT) Full text and rfc822 format available.

Reply sent to Moritz Mühlenhoff <jmm@inutil.org>:
You have taken responsibility. (Mon, 17 Jun 2013 16:57:47 GMT) Full text and rfc822 format available.

Notification sent to "bs.net" <bs.net@gmx.de>:
Bug acknowledged by developer. (Mon, 17 Jun 2013 16:57:47 GMT) Full text and rfc822 format available.

Message #16 received at 603735-done@bugs.debian.org (full text, mbox):

From: Moritz Mühlenhoff <jmm@inutil.org>
To: 602935-done@bugs.debian.org, 603665-done@bugs.debian.org, 603727-done@bugs.debian.org, 603735-done@bugs.debian.org, 604024-done@bugs.debian.org
Subject: Closing
Date: Mon, 17 Jun 2013 18:55:25 +0200
Hi,
your bug has been filed against the "linux-2.6" source package and was filed for
a kernel older than the recently released Debian 7.0 / Wheezy with a severity
less than important.

We don't have the ressources to reproduce the complete backlog of all older kernel
bugs, so we're closing this bug for now. If you can reproduce the bug with Debian Wheezy
or a more recent kernel from testing or unstable, please reopen the bug by sending
a mail to control@bugs.debian.org with the following three commands included in the
mail:

reopen BUGNUMBER
reassign BUGNUMBER src:linux
thanks

Cheers,
        Moritz
x



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 16 Jul 2013 07:29:09 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 12:54:56 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.