From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 13930] non-contiguous files (64.9%) on a ext4 fs
Date: Fri, 7 Aug 2009 22:20:53 GMT [thread overview]
Message-ID: <200908072220.n77MKrYv025705@demeter.kernel.org> (raw)
In-Reply-To: <bug-13930-13602@http.bugzilla.kernel.org/>
http://bugzilla.kernel.org/show_bug.cgi?id=13930
Theodore Tso <tytso@mit.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tytso@mit.edu
--- Comment #2 from Theodore Tso <tytso@mit.edu> 2009-08-07 22:20:51 ---
I'm pretty sure what's going on here is the problem I've reported before where
if you have a large number of large files being written at the same time, the
Linux page cleaner round-robins between the different dirty inodes to avoid
starving some inode from ever getting its dirty pages written out. This then
combines with ext4's multi-block allocator limiting its search for 8MB of free
extent chunks, so we only expand a dirty page writeback request into 2048
blocks. See the discussion here:
http://thread.gmane.org/gmane.comp.file-systems.ext4/13107
The reason why you're seeing this so much is that this filesystem has
relatively few inodes (just under 16,000) and a very large average inode size
(about 54 megabytes), and so a very large number of the files are
"non-contiguous". But, if you look at this statistic from e2fsck:
Histogramme des profondeurs d'extents : 14555/1388
14,555, or 91% of the files, have fewer than 4 extents, so that all of the
extents fit in the inode. (Note that an extent addresses at most 128 meg, so
by definition a 512meg file will have at least 4 extents.) That means it's
highly likely that if you look at a particularly large file using "filefrag
-v", you will see something like this:
ext logical physical expected length flags
0 0 2165248 512
1 512 2214400 2165759 1536
2 2048 2244608 2215935 2048
3 4096 2250752 2246655 2048
4 6144 2254848 2252799 32768
5 38912 2287616 8192
6 47104 2299904 2295807 2048
7 49152 2306048 2301951 2048 eof
Note that extent #5 is really located contiguously after extent #4; the reason
why a new extent was created is because the maximum length that can be encoded
in the on-disk extent data structure is 32,768 blocks. (Which if you are using
4k blocks, means a maximum extent size of 128 megs.)
So this kind of "non-contiguous" file is non-optimal, and we really should fix
the block allocator to better. On the other hand, it's not as disastrously
fragmented as say, the following file from an ext3 filesystem:
ext logical physical length
0 0 5228587 12
1 12 5228600 110
2 122 5228768 145
3 267 5228915 1
4 268 5228918 9
5 277 5228936 69
6 346 5229392 165
7 511 5230282 124
8 635 5230496 42
9 677 5231614 10
10 687 5231856 20
11 707 5231877 46
12 753 5231975 1
13 754 5232033 14
14 768 5232205 2
15 770 5233913 4
16 774 5233992 262
17 1036 5234256 191
Part of the problem is that "non-contiguous" or "fragmented" doesn't really
describe whether the file is like the first ext4 file (which is indeed
non-contiguous, and while it could be better allocated on disk, the time to
read the file sequentially won't be _that_ much worse than a file that 100%
contiguous), than say, a file like this second ext3 file, where the performance
degradation are much worse.
I suppose we could do something where we define "fragmented" as a file where
has no extents which are smaller than N blocks, or where the average extent
size is greater than M blocks. My original way of dealing with this number
was to simply use the phrase "non-contiguous" instead of "fragmented", which is
technically accurate, but it causes people to get overly concerned when they
see something like "64.9% non-contiguous files". Unfortunately, at moment
what this means is something like "approximately 65% of your files are greater
than 8 megabytes".
--
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
next prev parent reply other threads:[~2009-08-07 22:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-07 9:58 [Bug 13930] New: non-contiguous files (64.9%) on a ext4 fs bugzilla-daemon
2009-08-07 14:40 ` [Bug 13930] " bugzilla-daemon
2009-08-07 18:58 ` [Bug 13930] New: " Andreas Dilger
2009-08-07 19:08 ` Eric Sandeen
2009-08-08 0:16 ` Theodore Tso
2009-08-07 22:20 ` bugzilla-daemon [this message]
2009-08-07 22:38 ` [Bug 13930] " bugzilla-daemon
2009-08-08 1:30 ` bugzilla-daemon
2009-08-10 12:04 ` bugzilla-daemon
2009-08-10 13:11 ` bugzilla-daemon
2009-10-19 5:55 ` bugzilla-daemon
[not found] <bug-13930-13602@https.bugzilla.kernel.org/>
2012-06-13 14:42 ` bugzilla-daemon
2012-06-13 14:42 ` bugzilla-daemon
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=200908072220.n77MKrYv025705@demeter.kernel.org \
--to=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-ext4@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.