From: David Sterba <dsterba@suse.cz>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: allocate the free space by the existed max extent size when ENOSPC
Date: Thu, 29 Aug 2013 14:45:10 +0200 [thread overview]
Message-ID: <20130829124510.GH23113@twin.jikos.cz> (raw)
In-Reply-To: <1377755258-2722-1-git-send-email-miaox@cn.fujitsu.com>
On Thu, Aug 29, 2013 at 01:47:38PM +0800, Miao Xie wrote:
> By the current code, if the requested size is very large, and all the extents
> in the free space cache are small, we will waste lots of the cpu time to cut
> the requested size in half and search the cache again and again until it gets
> down to the size the allocator can return. In fact, we can know the max extent
> size in the cache after the first search, so we needn't cut the size in half
> repeatedly, and just use the max extent size directly. This way can save
> lots of cpu time and make the performance grow up when there are only fragments
> in the free space cache.
>
> According to my test, if there are only 4KB free space extents in the fs,
> and the total size of those extents are 256MB, we can reduce the execute
> time of the following test from 5.4s to 1.4s.
> dd if=/dev/zero of=<testfile> bs=1MB count=1 oflag=sync
Sounds like a good improvement! Can you please post the test? Fragmented
free space is nothing uncommon, so I guess aging the filesystem for a
while works as well and there the improvement would show up in reduced
cpu time.
Patch looks ok.
david
next prev parent reply other threads:[~2013-08-29 12:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 5:47 [PATCH] Btrfs: allocate the free space by the existed max extent size when ENOSPC Miao Xie
2013-08-29 12:45 ` David Sterba [this message]
2013-08-30 10:58 ` Miao Xie
2013-08-29 19:34 ` Josef Bacik
-- strict thread matches above, loose matches on Subject: below --
2013-08-30 10:35 Miao Xie
2013-09-06 13:47 ` Stefan Behrens
2013-09-09 6:21 ` Miao Xie
2013-09-09 9:06 ` Stefan Behrens
2013-09-17 13:13 ` David Sterba
2013-09-18 4:04 ` Miao Xie
2013-09-20 9:25 ` David Sterba
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=20130829124510.GH23113@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.com \
/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).