[Top] [All Lists]

Re: Online TRIM/discard performance impact

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: Online TRIM/discard performance impact
From: Martin Rusko <martin.rusko@xxxxxxxxx>
Date: Mon, 7 Nov 2011 15:31:44 +0100
Cc: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Wo6W8YezsyZCFkdEIWrrt4V3tnkaz0ihIddYj0WOFpw=; b=Kmz5s4x4mW5Iq7P+jjOoWzpny+nwkAGcmh+VjQ0vRZXfrihkxyheMGt1qYwlMMuy3+ o/+90j1/eRSp/VhkDp2t//WYdBFU47Uviubzz19mAWQZvIkl8C3fMFrL59CGz5E6XNiH L7wOYUyXIXBcWuU/6CoboHhv1suXoSQ6awLF8=
In-reply-to: <20111107102121.GA2891@xxxxxxxxxxxxx>
References: <CAMYYbY7=tRU1bmHkeBMesSC1jgXXz7J8-eUFm5VenVam3g1+nA@xxxxxxxxxxxxxx> <20111107102121.GA2891@xxxxxxxxxxxxx>
On Mon, Nov 7, 2011 at 11:21 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
> On Sat, Nov 05, 2011 at 09:07:05PM +0100, Martin Rusko wrote:
>> SSD drive in question is one of the latest with SF-2281 chipset. I
>> expected, that TRIM function will just schedule sectors for garbage
>> collection, which happens some time later (during which drive can be
>> potentially slower). Trying the same tests with ext4 filesystem, it
>> got following numbers.
> That's unfortunately not how it works - the TRIM command always drains
> the whole queue of outstanding requests, and thus has a fairly severe
> impact on performance.  We could reduce it a bit by using vectored
> trims like Windows does, but the Linux blocklayer doesn't have the
> infrastructure for that yet.
> Your workload will remove a lot of inode clusters on XFS, while ext4
> never deletes inodes. Using the ikeep mount option for XFS (can't be
> set during remount) should speed the performance with discard for
> your workload up a lot.  I would still recommand to do a periodic
> fstrim run instead, though.

As per man page ...

       When inode clusters are emptied of inodes, keep them around on
the disk (ikeep) - this is the traditional XFS behaviour and is still
       default for now.  Using the noikeep option, inode clusters are
returned to the free space pool.

... which would imply, that it should be actually rather fast by
default. Even if I had set this explicitly, it didn't really help ...

# mount -o noatime,discard,ikeep /dev/data/test-xfs /mnt/disk

/dev/mapper/data-test--xfs on /mnt/disk type xfs (rw,noatime,discard,ikeep)

# time rm -rf linux-3.0.8

real    4m47.897s
user    0m0.032s
sys     0m0.992s

... normally it would be deleted in a second or even faster.

I'm fine to use periodic fstrim, let say once a day. But this is such
a big difference, that it makes me curious if it is expected behavior
or if I'm doing something terribly wrong. Any idea? Thanks!


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