From: Eric Sandeen <sandeen@redhat.com>
To: Andreas Dilger <adilger@sun.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Theodore Tso <tytso@mit.edu>,
linux-ext4@vger.kernel.org
Subject: Re: [PATCH, RFC] ext4: New inode/block allocation algorithms for flex_bg filesystems
Date: Tue, 24 Feb 2009 18:58:38 -0600 [thread overview]
Message-ID: <49A497BE.1030700@redhat.com> (raw)
In-Reply-To: <49A49785.10000@redhat.com>
Eric Sandeen wrote:
> Andreas Dilger wrote:
>> Ted Ts'o wrote something like the following (didnt' get original email):
>>> @@ -122,6 +122,9 @@ struct ext4_inode_info {
>>> struct list_head i_prealloc_list;
>>> spinlock_t i_prealloc_lock;
>>>
>>> + /* ialloc */
>>> + ext4_group_t i_last_alloc_group;
>> Even better would be to store i_last_alloc_inode. In the past Eric
>> has demonstrated workloads that are allocating lots of inodes exhibit
>> O(n^2) behaviour because the entire group bitmap is searched from the
>> start each time, and that can cumulatively be very slow. Having the
>> directory start searching from the most recently allocated inode would
>> make this O(n), and would not significantly alter behaviour.
>
> A very hacky benchmark I had to demonstrate this is at
Er, URL please, maestro...
http://people.redhat.com/esandeen/benchmarks/seq_mkdirs.c
> It just creates a directory tree starting at 000/ under the dir it's run
> in, and times iterations of creates.
>
> The tree is created in order, like:
>
> 000/000/000/000/000/000
> 000/000/000/000/000/001
> 000/000/000/000/000/002
> ...
> 000/000/000/000/000/fff
> 000/000/000/000/001/000
> ....
>
> On ext3:
>
> # ./seq_mkdirs
> iter 0: 6.191491 sec
> iter 1: 8.455782 sec
> iter 2: 9.435375 sec
> iter 3: 10.198069 sec
> iter 4: 10.922969 sec
> iter 5: 10.800908 sec
> iter 6: 12.940676 sec
> iter 7: 15.513261 sec
> ...
>
> On upstream ext4:
>
> # ./seq_mkdirs
> iter 0: 5.628331 sec
> iter 1: 6.581043 sec
> iter 2: 6.723445 sec
> iter 3: 6.567891 sec
> iter 4: 5.862526 sec
> iter 5: 6.462064 sec
> iter 6: 7.208110 sec
> iter 7: 6.549735 sec
> ...
>
>
> I did play with saving the last-allocated position but if that's just
> in-memory then it's a little odd that the first allocation will be
> potentially much slower, but that's probably acceptable. It also
> wouldn't fill in gaps when inodes are deleted if you don't re-search
> from the parent. ISTR that the constant create/delete didn't cause a
> problem, will need to remind myself why ...
>
> -Eric
>
next prev parent reply other threads:[~2009-02-25 0:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 15:43 [PATCH, RFC] ext4: New inode/block allocation algorithms for flex_bg filesystems Theodore Tso
2009-02-24 8:59 ` Aneesh Kumar K.V
2009-02-24 15:27 ` Theodore Tso
2009-02-24 19:04 ` Theodore Tso
2009-02-24 22:41 ` Andreas Dilger
2009-02-25 0:57 ` Eric Sandeen
2009-02-25 0:58 ` Eric Sandeen [this message]
2009-02-25 2:50 ` Theodore Tso
2009-02-26 18:21 ` Theodore Tso
2009-02-26 18:38 ` Aneesh Kumar K.V
2009-03-30 8:48 ` Aneesh Kumar K.V
2009-02-27 0:15 ` Andreas Dilger
2009-02-27 9:17 ` Andreas Dilger
2009-02-27 15:06 ` Theodore Tso
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=49A497BE.1030700@redhat.com \
--to=sandeen@redhat.com \
--cc=adilger@sun.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).