linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Robert Mueller <robm@fastmail.fm>
Cc: Eric Sandeen <sandeen@redhat.com>,
	Bron Gondwana <brong@fastmail.fm>,
	linux-ext4@vger.kernel.org
Subject: Re: fallocate creating fragmented files
Date: Wed, 30 Jan 2013 16:43:59 -0500	[thread overview]
Message-ID: <20130130214359.GD32724@thunk.org> (raw)
In-Reply-To: <1359580910.30605.140661184656041.31047642@webmail.messagingengine.com>

On Thu, Jan 31, 2013 at 08:21:50AM +1100, Robert Mueller wrote:
> 
> For that matter, one big question I have is why each of these results is
> so different.
> 
> [robm@imap14 conf]$ for i in 1 2 3 4 5 6 7 8 9 10; do fallocate -l 20m
> testfile3; filefrag testfile3; /bin/rm testfile3; done

The most likely reason is that it depends on transaction boundaries.
After a block has been released, we can't reuse it until after the
jbd2 transaction which contains the deletion of the inode has
committed.  So even after you've deleted the file, we can't reuse the
blocks right away.  The other thing which will influence the block
allocation is which block group the last allocation was for that
particular file.  So if blocks become available after a commit
completes, if we've started allocating in another block group, we
won't go back to the initial block group.

Cheers,

					- Ted


  reply	other threads:[~2013-01-30 21:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  5:46 fallocate creating fragmented files Bron Gondwana
2013-01-30  6:05 ` Eric Sandeen
2013-01-30  6:35   ` Bron Gondwana
2013-01-30 15:56     ` Eric Sandeen
2013-01-30 20:14       ` Theodore Ts'o
2013-01-30 21:21         ` Robert Mueller
2013-01-30 21:43           ` Theodore Ts'o [this message]
2013-01-30 22:40             ` Bron Gondwana
2013-01-30 22:49               ` Robert Mueller
2013-01-30 22:51             ` Robert Mueller
2013-02-01 11:33               ` Bron Gondwana
2013-02-01 13:55                 ` Theodore Ts'o
2013-02-02 10:50                   ` Bron Gondwana

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=20130130214359.GD32724@thunk.org \
    --to=tytso@mit.edu \
    --cc=brong@fastmail.fm \
    --cc=linux-ext4@vger.kernel.org \
    --cc=robm@fastmail.fm \
    --cc=sandeen@redhat.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).