linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kai Krakow <hurikhan77+btrfs@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: Options for SSD - autodefrag etc?
Date: Sat, 25 Jan 2014 15:06:24 +0100	[thread overview]
Message-ID: <00tcra-bh7.ln1@hurikhan77.spdns.de> (raw)
In-Reply-To: 1730344.q7ECaAgUWV@merkaba

Martin Steigerwald <Martin@lichtvoll.de> schrieb:

> Okay, I have seen 260 MB/s. But frankly I am pretty sure that Virtuoso
> isn´t doing this kind of large scale I/O on a highly fragmented file. Its
> a database. Its random access. My oppinion is that Virtuoso couldn´t care
> less about the fragmentation of the file. As long as it is stored on the
> SSD.

I think it makes no real difference here since access to virtuoso is random 
anyway. And if I got you right you run it nocow, so upon writes you aren't 
introducing more fragmentation to the file. All is good... It probably would 
even be good with cow as virtuoso is read-most, so rarely written to. 

For VM images it might be a whole different story. The guest system sees a 
block device and expects it to be continuous. All optimizations for access 
patterns cannot work right if btrfs is constantly moving parts of the file 
around for doing cow. So make it nocow and all should be as good as it can 
get.

> Well… take this with caveat. This is LZO compressed, those 2,4 GiB / 128
> KiB gives at least about 20000 extents already provided that my
> calculation is correct. And these extents could be sequential (I doubt it
> tough also give the high free space fragmention I suspect to be on this
> FS).

Your CPU is more mighty than the flash chips. LZO improves read performance. 
But does it make sense on Intel drives? I think they already do compression.

> Anyway: I do not perceive any noticable performance issues due to file
> fragmentation on SSD and think that at least on highly filled BTRFS
> filesystem autodefrag may do more harm than good (like fragment free space
> and then let btrfs-delalloc go crazy on new allocations). I know xfs_fsr
> for defragmenting XFS in the background, even via cron job. And I think I
> remember Dave Chinner telling in some post that even for harddisks it may
> not be a very wise idea to run this frequently due to the risk to fragment
> free space.
> 
> There are several kinds of fragmentations. And defragmenting files may
> increase freespace fragmentation.

This is why I wondered if btrfs will be optimized for keeping free space 
together in the future for SSD. But it's not as simple as this. It should 
not scatter file blocks all over the disk just to fill tiny holes. It should 
try to keep file blocks together so the read-modify-write-erase cycle of 
SSDs can work optimally.

> Thus, I am not yet convinced regarding autodefrag on SSDs.

I think everything would be easier if btrfs exposed some stats about what 
the autodefrag thread is really doing...

-- 
Replies to list only preferred.


  reply	other threads:[~2014-01-25 14:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 22:23 Options for SSD - autodefrag etc? KC
2014-01-24  6:54 ` Duncan
2014-01-25 12:54   ` Martin Steigerwald
2014-01-26 21:44     ` Duncan
2014-01-24 20:14 ` Kai Krakow
2014-01-25 13:11   ` Martin Steigerwald
2014-01-25 14:06     ` Kai Krakow [this message]
2014-01-25 16:19       ` Martin Steigerwald
  -- strict thread matches above, loose matches on Subject: below --
2014-01-24 18:55 KC
2014-01-24 20:27 ` Kai Krakow
2014-01-25  5:09   ` Duncan
2014-01-25 13:33   ` Imran Geriskovan
2014-01-25 14:01     ` Martin Steigerwald
2014-01-26 17:18       ` Duncan
     [not found]         ` <KA9w1n01A0tVtje01A9yLn>
2014-01-28 11:41           ` Duncan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00tcra-bh7.ln1@hurikhan77.spdns.de \
    --to=hurikhan77+btrfs@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).