xfs
[Top] [All Lists]

Re: [xfs-masters] how to use fstrim?

To: Stefan Priebe <s.priebe@xxxxxxxxxxxx>
Subject: Re: [xfs-masters] how to use fstrim?
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 27 Jul 2013 11:50:29 +1000
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>, "xfs-masters@xxxxxxxxxxx" <xfs-masters@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <51F2BD31.5060301@xxxxxxxxxxxx>
References: <51F2BD31.5060301@xxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>