linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Ron Johnson <ron.l.johnson@cox.net>
Cc: linux-ext4@vger.kernel.org
Subject: Re: file allocation problem
Date: Mon, 20 Jul 2009 15:18:31 -0600	[thread overview]
Message-ID: <20090720211831.GV4231@webber.adilger.int> (raw)
In-Reply-To: <4A63A1F1.9040703@cox.net>

On Jul 19, 2009  17:45 -0500, Ron Johnson wrote:
> On 2009-07-17 16:14, Andreas Dilger wrote:
>> Well, this isn't quite correct.  The mballoc code only tries to allocate
>> "large" files on power-of-two boundaries, where large is 64kB by default,
>> but is tunable in /proc.  For smaller files it tries to pack them together
>> into the same block, or into gaps that are exactly the size of the file.
>
> How does ext4 act on growing files?  I.e., creating a tarball that,  
> obviously, starts at 0 bytes and then grows to multi-GB?

ext4 has "delayed allocation" (delalloc) so that no blocks are allocated
during initial file writes, but rather only when RAM is running short or
when the data has been sitting around for a while.

Normally, if you are writing to a file with _most_ applications the IO
rate is high enough that within the 5-30s memory flush interval the
size of the file has grown large enough to give the allocator an idea
whether the file will be small or large.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


      reply	other threads:[~2009-07-20 21:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 11:31 file allocation problem Stephan Kulow
2009-07-16 15:58 ` Theodore Tso
2009-07-16 17:43   ` Stephan Kulow
2009-07-17  1:12     ` Theodore Tso
2009-07-17  4:32       ` Andreas Dilger
2009-07-17  5:31         ` Stephan Kulow
2009-07-17  5:17       ` Stephan Kulow
2009-07-17 14:26         ` Theodore Tso
2009-07-17 18:02           ` Stephan Kulow
2009-07-17 21:14             ` Andreas Dilger
2009-07-18 21:16               ` Stephan Kulow
2009-07-19 22:45               ` Ron Johnson
2009-07-20 21:18                 ` Andreas Dilger [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=20090720211831.GV4231@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ron.l.johnson@cox.net \
    /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).