SSD detection when creating first time fstab ?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

SSD detection when creating first time fstab ?

Vincent Lejeune
Hi,

The setup process of opensuse creates a /etc/fstab according to partition settings on the SSD/hard drive.
However there is no detection of the type (ie SSD or hard drive) during this process.

I discovered that the TRIM functionnality was not supported by default on ext4 file system. 
TRIM aims at extending duration of SSD by delaying some write/delete operations ; besides it improves performance of SSD.

To get TRIM support on ext4, the partition must be mounted with the "discard" option in /etc/fstab.
Would it be possible for 12.1 to make the detection script able to spot a SSD and add this option at the setup step of openSUSE installation ?
I think that SSD users are not always aware that they need to tweak their /etc/fstab to preserve their drive...

I have no idea if TRIM support can be retrieved from SSD information at the kernel level.

Vincent
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SSD detection when creating first time fstab ?

gregfreemyer
On Thu, Jun 2, 2011 at 10:43 AM, Vincent Lejeune <[hidden email]> wrote:

> Hi,
>
> The setup process of opensuse creates a /etc/fstab according to partition settings on the SSD/hard drive.
> However there is no detection of the type (ie SSD or hard drive) during this process.
>
> I discovered that the TRIM functionnality was not supported by default on ext4 file system.
> TRIM aims at extending duration of SSD by delaying some write/delete operations ; besides it improves performance of SSD.
>
> To get TRIM support on ext4, the partition must be mounted with the "discard" option in /etc/fstab.
> Would it be possible for 12.1 to make the detection script able to spot a SSD and add this option at the setup step of openSUSE installation ?
> I think that SSD users are not always aware that they need to tweak their /etc/fstab to preserve their drive...
>
> I have no idea if TRIM support can be retrieved from SSD information at the kernel level.
>
> Vincent

Vincent,

Give this a read:

http://en.opensuse.org/SDB:SSD_discard_%28trim%29_support

I wrote most of that.  It's about 6 or 9 months out of date, so the
discussion of FITRIM is deficient (or missing).  FITRIM is a kernel
ioctl which was just added to the kernel last fall.  (2.6.36? 2.6.37?)

I for one sincerely hope "mount -discard" is not an automatic feature
of 12.1.  In all honesty, I wish it was dropped from the kernel
altogether.  I still haven't seen any real world drive that gets
improved performance by interlacing trims into the middle of the
normal i/o traffic.  But the kernel devs won't drop it because "there
are devices in the lab that benefit from it".  I've been hearing that
for 2 or 3 years now.  But the devices never get out of the lab.

Also, it was assumed 9 months ago that Windows 7 did it that way.  But
since then one of the kernel devs got a sata protocol analyser and
monitored how Windows 7 is doing it.  Not like "mount -discard" at
all, so that whole paradigm seems like a rat hole to me.

On the other hand, I would like to see the FITRIM ioctl called via
cron in the middle of the night in 12.1.  The userspace tool that
calls that is fstrim.  It is part or 11.4 I believe (I know its in
Tumbleweed).  So calling fstrim via cron would be great.  And if the
drive or block layer doesn't handle trim commands, the FITRIM ioctl
should just drop the discards on the ground.  That is really the best
option in my mind right now.

Note FITRIM is still not as good as what Windows 7 is doing.  The
claim is aggregating multiple trim ranges into one ATA command is hard
for the kernel to do, so it is still on the wish list, not the done
list.

Anyway, FITRIM does show performance benefit for real world drives and
it does the interrogation of the drive / block stack to see discard is
supported.  Thus, openSUSE 12.1 would not need to know in advance if a
drive supported discard or not, it would just call fstrim on every
filesystem.

So, if you create a openfate entry to have 12.1 call fstrim via cron,
I for one would likely vote for it.

Note: There is still discussion on the kernel lists about the best way
to handle discard.  So for 12.2 it maybe back to being a kernel mount
option which triggers a kernel thread to run and maintain a background
free block scavenger.  It really is up in the air.  So one could argue
that it is still premature to put a real fix in 12.1 just to see it
removed in 12.2 in favor of a totally different fix.

Thanks
Greg
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re : SSD detection when creating first time fstab ?

Vincent Lejeune
Hi,

thank for your explanations ; I was not aware of the performance issue of mount-discard.

I didn't see any true performance improvement by using this option, but I didn't run synthetic benchmark to check this.
I ran wiper.sh but no perceptible performance improvement as well... maybe it's only marginally faster ?


I posted a feature request :


https://features.opensuse.org/312476

Vincent



----- Mail original -----

> De : Greg Freemyer <[hidden email]>
> À : Vincent Lejeune <[hidden email]>
> Cc : "[hidden email]" <[hidden email]>
> Envoyé le : Jeudi 2 Juin 2011 17h32
> Objet : Re: [opensuse-factory] SSD detection when creating first time fstab ?
>
> On Thu, Jun 2, 2011 at 10:43 AM, Vincent Lejeune <[hidden email]> wrote:
>>  Hi,
>>
>>  The setup process of opensuse creates a /etc/fstab according to partition
> settings on the SSD/hard drive.
>>  However there is no detection of the type (ie SSD or hard drive) during
> this process.
>>
>>  I discovered that the TRIM functionnality was not supported by default on
> ext4 file system.
>>  TRIM aims at extending duration of SSD by delaying some write/delete
> operations ; besides it improves performance of SSD.
>>
>>  To get TRIM support on ext4, the partition must be mounted with the
> "discard" option in /etc/fstab.
>>  Would it be possible for 12.1 to make the detection script able to spot a
> SSD and add this option at the setup step of openSUSE installation ?
>>  I think that SSD users are not always aware that they need to tweak their
> /etc/fstab to preserve their drive...
>>
>>  I have no idea if TRIM support can be retrieved from SSD information at the
> kernel level.
>>
>>  Vincent
>
> Vincent,
>
> Give this a read:
>
> http://en.opensuse.org/SDB:SSD_discard_%28trim%29_support
>
> I wrote most of that.  It's about 6 or 9 months out of date, so the
> discussion of FITRIM is deficient (or missing).  FITRIM is a kernel
> ioctl which was just added to the kernel last fall.  (2.6.36? 2.6.37?)
>
> I for one sincerely hope "mount -discard" is not an automatic feature
> of 12.1.  In all honesty, I wish it was dropped from the kernel
> altogether.  I still haven't seen any real world drive that gets
> improved performance by interlacing trims into the middle of the
> normal i/o traffic.  But the kernel devs won't drop it because "there
> are devices in the lab that benefit from it".  I've been hearing that
> for 2 or 3 years now.  But the devices never get out of the lab.
>
> Also, it was assumed 9 months ago that Windows 7 did it that way.  But
> since then one of the kernel devs got a sata protocol analyser and
> monitored how Windows 7 is doing it.  Not like "mount -discard" at
> all, so that whole paradigm seems like a rat hole to me.
>
> On the other hand, I would like to see the FITRIM ioctl called via
> cron in the middle of the night in 12.1.  The userspace tool that
> calls that is fstrim.  It is part or 11.4 I believe (I know its in
> Tumbleweed).  So calling fstrim via cron would be great.  And if the
> drive or block layer doesn't handle trim commands, the FITRIM ioctl
> should just drop the discards on the ground.  That is really the best
> option in my mind right now.
>
> Note FITRIM is still not as good as what Windows 7 is doing.  The
> claim is aggregating multiple trim ranges into one ATA command is hard
> for the kernel to do, so it is still on the wish list, not the done
> list.
>
> Anyway, FITRIM does show performance benefit for real world drives and
> it does the interrogation of the drive / block stack to see discard is
> supported.  Thus, openSUSE 12.1 would not need to know in advance if a
> drive supported discard or not, it would just call fstrim on every
> filesystem.
>
> So, if you create a openfate entry to have 12.1 call fstrim via cron,
> I for one would likely vote for it.
>
> Note: There is still discussion on the kernel lists about the best way
> to handle discard.  So for 12.2 it maybe back to being a kernel mount
> option which triggers a kernel thread to run and maintain a background
> free block scavenger.  It really is up in the air.  So one could argue
> that it is still premature to put a real fix in 12.1 just to see it
> removed in 12.2 in favor of a totally different fix.
>
> Thanks
> Greg
>
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re : SSD detection when creating first time fstab ?

gregfreemyer
On Sat, Jun 4, 2011 at 5:59 PM, Vincent Lejeune <[hidden email]> wrote:

> Hi,
>
> thank for your explanations ; I was not aware of the performance issue of mount-discard.
>
> I didn't see any true performance improvement by using this option, but I didn't run synthetic benchmark to check this.
> I ran wiper.sh but no perceptible performance improvement as well... maybe it's only marginally faster ?
>
>
> I posted a feature request :
>
>
> https://features.opensuse.org/312476
>
> Vincent

Great,

I just voted for it and added a positive comment.

It will show up in a weekly news update soon so the community can see
it (and hopefully vote for it.)

Greg
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re : SSD detection when creating first time fstab ?

Bruno Friedmann-2
On 06/05/2011 12:12 AM, Greg Freemyer wrote:

> On Sat, Jun 4, 2011 at 5:59 PM, Vincent Lejeune <[hidden email]> wrote:
>> Hi,
>>
>> thank for your explanations ; I was not aware of the performance issue of mount-discard.
>>
>> I didn't see any true performance improvement by using this option, but I didn't run synthetic benchmark to check this.
>> I ran wiper.sh but no perceptible performance improvement as well... maybe it's only marginally faster ?
>>
>>
>> I posted a feature request :
>>
>>
>> https://features.opensuse.org/312476
>>
>> Vincent
>
> Great,
>
> I just voted for it and added a positive comment.
>
> It will show up in a weekly news update soon so the community can see
> it (and hopefully vote for it.)
>
> Greg

Greg where did you find it.
The project main page said Fstrim has been already merged into util-linux-ng!
But I didn't find it on factory nor software.o.o nor obs

Can you give me a link for that ?


--

Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch

openSUSE Member & Ambassador
GPG KEY : D5C9B751C4653227
irc: tigerfoot
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re : SSD detection when creating first time fstab ?

gregfreemyer
On Sun, Jun 5, 2011 at 3:51 AM, Bruno Friedmann <[hidden email]> wrote:

> On 06/05/2011 12:12 AM, Greg Freemyer wrote:
>> On Sat, Jun 4, 2011 at 5:59 PM, Vincent Lejeune <[hidden email]> wrote:
>>> Hi,
>>>
>>> thank for your explanations ; I was not aware of the performance issue of mount-discard.
>>>
>>> I didn't see any true performance improvement by using this option, but I didn't run synthetic benchmark to check this.
>>> I ran wiper.sh but no perceptible performance improvement as well... maybe it's only marginally faster ?
>>>
>>>
>>> I posted a feature request :
>>>
>>>
>>> https://features.opensuse.org/312476
>>>
>>> Vincent
>>
>> Great,
>>
>> I just voted for it and added a positive comment.
>>
>> It will show up in a weekly news update soon so the community can see
>> it (and hopefully vote for it.)
>>
>> Greg
>
> Greg where did you find it.
> The project main page said Fstrim has been already merged into util-linux-ng!
> But I didn't find it on factory nor software.o.o nor obs
>
> Can you give me a link for that ?

I think util-linux-ng was renamed back to util-linux at some point.

I have util-linux-2.19 installed in my desktop and I have fstrim.

Note that zypper wp fstrim is not reporting anything.

Greg
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]