* how to use fstrim?
@ 2013-07-26 18:17 Stefan Priebe
2013-07-26 21:37 ` Eric Sandeen
2013-07-27 1:50 ` [xfs-masters] " Dave Chinner
0 siblings, 2 replies; 7+ messages in thread
From: Stefan Priebe @ 2013-07-26 18:17 UTC (permalink / raw)
To: xfs@oss.sgi.com; +Cc: xfs-masters@oss.sgi.com
Hi,
what is the right way to use fstrim on top of XFS? just doing fstrim -v
-m 4194304 /
results sometimes (might depend on disk i/o) to hanging tasks and stack
traces - fstrim needs > 5 min in these cases.
Thanks!
Greets,
Stefan
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: how to use fstrim?
2013-07-26 18:17 how to use fstrim? Stefan Priebe
@ 2013-07-26 21:37 ` Eric Sandeen
2013-07-27 1:50 ` [xfs-masters] " Dave Chinner
1 sibling, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2013-07-26 21:37 UTC (permalink / raw)
To: Stefan Priebe; +Cc: xfs@oss.sgi.com
On 7/26/13 1:17 PM, Stefan Priebe wrote:
> Hi,
>
> what is the right way to use fstrim on top of XFS? just doing fstrim -v -m 4194304 /
>
> results sometimes (might depend on disk i/o) to hanging tasks and stack traces - fstrim needs > 5 min in these cases.
As always, it's better to include things like the actual stack traces you got, so we have some idea what's going on ...
How fast it goes probably depends quite a lot on the storage underneath.
So including storage information as well would also help us give you a meaningful answer...
And kernel version... etc.
http://xfs.org/index.php/XFS_FAQ#Q:_What_information_should_I_include_when_reporting_a_problem.3F
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [xfs-masters] how to use fstrim?
2013-07-26 18:17 how to use fstrim? Stefan Priebe
2013-07-26 21:37 ` Eric Sandeen
@ 2013-07-27 1:50 ` Dave Chinner
2013-07-30 19:37 ` Stefan Priebe
2013-07-31 13:26 ` Greg Freemyer
1 sibling, 2 replies; 7+ messages in thread
From: Dave Chinner @ 2013-07-27 1:50 UTC (permalink / raw)
To: Stefan Priebe; +Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com
On Fri, Jul 26, 2013 at 08:17:21PM +0200, Stefan Priebe wrote:
> Hi,
>
> what is the right way to use fstrim on top of XFS? just doing fstrim
> -v -m 4194304 /
>
> results sometimes (might depend on disk i/o) to hanging tasks and
> stack traces - fstrim needs > 5 min in these cases.
It does indeed depend on disk IO. XFS walks all the free space and
issues discards on it, so runtime is always O(freespace). And while
it is walking an AG discarding the free space, it will hold the AG
locked so that free space doesn't change. This can hang other
operations for the length of time it takes to discard all the free
space in the AG.
IOWs, the behaviour of fstrim on XFS is entirely dependent on the
speed of the block layer and hardware implementations of discards.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [xfs-masters] how to use fstrim?
2013-07-27 1:50 ` [xfs-masters] " Dave Chinner
@ 2013-07-30 19:37 ` Stefan Priebe
2013-07-30 22:34 ` Dave Chinner
2013-07-31 13:26 ` Greg Freemyer
1 sibling, 1 reply; 7+ messages in thread
From: Stefan Priebe @ 2013-07-30 19:37 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com
Am 27.07.2013 03:50, schrieb Dave Chinner:
> On Fri, Jul 26, 2013 at 08:17:21PM +0200, Stefan Priebe wrote:
>> Hi,
>>
>> what is the right way to use fstrim on top of XFS? just doing fstrim
>> -v -m 4194304 /
>>
>> results sometimes (might depend on disk i/o) to hanging tasks and
>> stack traces - fstrim needs > 5 min in these cases.
>
> It does indeed depend on disk IO. XFS walks all the free space and
> issues discards on it, so runtime is always O(freespace). And while
> it is walking an AG discarding the free space, it will hold the AG
> locked so that free space doesn't change. This can hang other
> operations for the length of time it takes to discard all the free
> space in the AG.
> IOWs, the behaviour of fstrim on XFS is entirely dependent on the
> speed of the block layer and hardware implementations of discards.
Yes OK i understand that but is there any way to prevent getting the
whole server crash when I/O is too much?
For example splitting whole disk or even AGs into subparts? Or set a
timeout for the fstrim command?
Greets,
Stefan
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [xfs-masters] how to use fstrim?
2013-07-30 19:37 ` Stefan Priebe
@ 2013-07-30 22:34 ` Dave Chinner
0 siblings, 0 replies; 7+ messages in thread
From: Dave Chinner @ 2013-07-30 22:34 UTC (permalink / raw)
To: Stefan Priebe; +Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com
On Tue, Jul 30, 2013 at 09:37:15PM +0200, Stefan Priebe wrote:
> Am 27.07.2013 03:50, schrieb Dave Chinner:
> >On Fri, Jul 26, 2013 at 08:17:21PM +0200, Stefan Priebe wrote:
> >>Hi,
> >>
> >>what is the right way to use fstrim on top of XFS? just doing fstrim
> >>-v -m 4194304 /
> >>
> >>results sometimes (might depend on disk i/o) to hanging tasks and
> >>stack traces - fstrim needs > 5 min in these cases.
> >
> >It does indeed depend on disk IO. XFS walks all the free space and
> >issues discards on it, so runtime is always O(freespace). And while
> >it is walking an AG discarding the free space, it will hold the AG
> >locked so that free space doesn't change. This can hang other
> >operations for the length of time it takes to discard all the free
> >space in the AG.
> > IOWs, the behaviour of fstrim on XFS is entirely dependent on the
> > speed of the block layer and hardware implementations of discards.
>
> Yes OK i understand that but is there any way to prevent getting the
> whole server crash when I/O is too much?
Sorry, what crash are you talking about? IO being slow because you
ran fstrim isn't a crash....
> For example splitting whole disk or even AGs into subparts? Or set a
> timeout for the fstrim command?
You can split fstrim up into smaller sections yourself by using the
range parameters.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [xfs-masters] how to use fstrim?
2013-07-27 1:50 ` [xfs-masters] " Dave Chinner
2013-07-30 19:37 ` Stefan Priebe
@ 2013-07-31 13:26 ` Greg Freemyer
2013-08-01 0:08 ` Dave Chinner
1 sibling, 1 reply; 7+ messages in thread
From: Greg Freemyer @ 2013-07-31 13:26 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com, Stefan Priebe
On Fri, Jul 26, 2013 at 9:50 PM, Dave Chinner <david@fromorbit.com> wrote:
> IOWs, the behaviour of fstrim on XFS is entirely dependent on the
> speed of the block layer and hardware implementations of discards.
And on a lot of SSDs, trim seems to act like a cache flush so it can
hit performance hard. It should be scheduled for off-peak times
afaik. It's not critical to run hourly or even daily. If you can
schedule it once a week when other i/o is light that should be enough
for most workloads.
Greg
--
Greg Freemyer
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [xfs-masters] how to use fstrim?
2013-07-31 13:26 ` Greg Freemyer
@ 2013-08-01 0:08 ` Dave Chinner
0 siblings, 0 replies; 7+ messages in thread
From: Dave Chinner @ 2013-08-01 0:08 UTC (permalink / raw)
To: Greg Freemyer; +Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com, Stefan Priebe
On Wed, Jul 31, 2013 at 09:26:35AM -0400, Greg Freemyer wrote:
> On Fri, Jul 26, 2013 at 9:50 PM, Dave Chinner <david@fromorbit.com> wrote:
> > IOWs, the behaviour of fstrim on XFS is entirely dependent on the
> > speed of the block layer and hardware implementations of discards.
>
> And on a lot of SSDs, trim seems to act like a cache flush so it can
> hit performance hard.
That's because TRIM on SATA3 is an unqueued command. It basically
causes the pipeline to be emptied before it can be issued, and no
further IO can be issued until it completes. SATA3.1 is supposed to
add a queued TRIM command, but it might be some time before we see
that appearing in hardware...
> It should be scheduled for off-peak times
> afaik. It's not critical to run hourly or even daily. If you can
> schedule it once a week when other i/o is light that should be enough
> for most workloads.
I run it once every couple of months on my SSDs, if ever. Most
modern SSDs have background defragmentation so if they are left idle
for a couple of hours they clean themselves up pretty well without
needing TRIM...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-08-01 0:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26 18:17 how to use fstrim? Stefan Priebe
2013-07-26 21:37 ` Eric Sandeen
2013-07-27 1:50 ` [xfs-masters] " Dave Chinner
2013-07-30 19:37 ` Stefan Priebe
2013-07-30 22:34 ` Dave Chinner
2013-07-31 13:26 ` Greg Freemyer
2013-08-01 0:08 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox