linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Justin Maggard <jmaggard10@gmail.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: Space cache degradation
Date: Wed, 2 Apr 2014 14:00:17 -0400	[thread overview]
Message-ID: <533C5031.7090600@fb.com> (raw)
In-Reply-To: <CAKgsxVSJEug-R-OT3Z2TF5JFf-AU+hw4MaPOnupDV2CZBBLU7A@mail.gmail.com>



On 04/02/2014 01:54 PM, Justin Maggard wrote:
> I've found that, after using some btrfs filesystems for some time,
> that the first large write after a reboot takes a very long time.  So
> I went to work trying out different test cases to simplify
> reproduction of the issue, and I've got it down to just these steps:
>
> 1) mkfs.btrfs on a large-ish device.  I used a 14TB MD RAID5 device.
> 2) Fill it up a bit over half-way with ~5MB files.  In my test I made
> 30 copies of a 266GB data set consisting of 52,356 files and 20,268
> folders.
> 3) umount
> 4) mount
> 5) time fallocate -l 2G /mount/point/2G.dat
> real 3m9.412s
> user 0m0.002s
> sys 0m2.939s
>
> By comparison, if I don't use space cache things go much better:
> # umount
> # mount -o nospace_cache
> # time fallocate -l 2G /mount/point/2G.dat
> real 0m15.982s
> user 0m0.002s
> sys 0m0.103s
>
> If I use the clear_cache mount option, that also resolves the slowness.
>
> Is this a known issue?  For me it's 100% reproducible, on various
> kernel versions including 3.14-rc8.  Is there anything I should
> provide to help debug?
>

Neat, not a known issue.  What's probably happening is that without 
space cache on, you're jumping out into unused space while it 
regenerates the space cache.  Once the caching thread is done caching 
all the free space, you should go slowly again.

I'll try to reproduce.

-chris




      reply	other threads:[~2014-04-02 18:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 17:54 Space cache degradation Justin Maggard
2014-04-02 18:00 ` Chris Mason [this message]

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=533C5031.7090600@fb.com \
    --to=clm@fb.com \
    --cc=jmaggard10@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).