public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Linus Torvalds <torvalds@transmeta.com>,
	Roman Zippel <zippel@fh-brandenburg.de>
Cc: Andrea Arcangeli <andrea@suse.de>,
	"Eric W. Biederman" <ebiederman@uswest.net>,
	Alexander Viro <viro@math.psu.edu>,
	Daniel Phillips <phillips@innominate.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] Generic deferred file writing
Date: Tue, 02 Jan 2001 13:27:06 -0500	[thread overview]
Message-ID: <138080000.978460026@tiny> (raw)
In-Reply-To: <Pine.LNX.4.10.10012301816410.1743-100000@penguin.transmeta.com>



On Saturday, December 30, 2000 06:28:39 PM -0800 Linus Torvalds
<torvalds@transmeta.com> wrote:
 
> There are only two real advantages to deferred writing:
> 
>  - not having to do get_block() at all for temp-files, as we never have to
>    do the allocation if we end up removing the file.
> 
>    NOTE NOTE NOTE! The overhead for trying to get ENOSPC and quota errors
>    right is quite possibly big enough that this advantage is possibly very
>    questionable.  It's very possible that people could speed things up
>    using this approach, but I also suspect that it is equally (if not
>    more) possible to speed things up by just making sure that the
>    low-level FS has a fast get_block().
> 
>  - Using "global" access patterns to do a better job of "get_block()", ie
>    taking advantage of issues with journalling etc and deferring the write
>    in order to get a bigger journal.
> 
> The second point is completely different, and THIS is where I think there
> are potentially real advantages. 

Absolutely.  I wrote reiserfs delayed allocation code back in october, and
kind of left it alone until the VM had the callbacks needed to make it
clean (err, less ugly).  I included bunches of optimizations to
reiserfs_get_block, and the most effective one was a cache of block
pointers in the inode to avoid consecutive tree searches.  This was a
locking and an i/o win, for both reading and writing (reiserfs needs this
more than ext2 does)

For growing the file, delayed allocation was a huge bonus.  For all the
reasons you've already discussed, and because writing a file went from this:
 
(reiserfs_get_block is starting/stopping the transaction)
while(bytes_to_write) 
	start_transaction
	allocate block
	insert block pointer
	end_transaction
end

To this:

while(bytes_to_write)
	update counters
end

(delayed alloc routine is starting/stopping trans)
start_transaction
allocate X blocks
insert X block pointers
update counters
end_transaction

A big fat transaction is a happy one ;-)

Anyway, I'll return to the optimizations once things have settled down a
bit, and might give the generic delayed allocation (instead of reiserfs
only code) a try.

-chris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-02 18:58 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-30  0:25 test13-pre6 Linus Torvalds
2000-12-30  0:49 ` test13-pre6 Alexander Viro
2000-12-30  1:03   ` test13-pre6 Linus Torvalds
2000-12-30 18:09     ` test13-pre6 Alexander Viro
2000-12-30  2:25 ` test13-pre6 Daniel Phillips
2000-12-30  3:16   ` test13-pre6 Linus Torvalds
2000-12-30 18:58     ` [RFC] Generic deferred file writing Daniel Phillips
2000-12-30 20:05       ` Linus Torvalds
2000-12-30 20:06       ` Alexander Viro
2000-12-30 20:21         ` Linus Torvalds
2000-12-30 21:10           ` Andreas Dilger
2000-12-30 21:46           ` Alexander Viro
2000-12-30 23:12             ` Daniel Phillips
2000-12-30 22:00           ` Eric W. Biederman
2000-12-30 22:44             ` Linus Torvalds
2000-12-31  0:26               ` Eric W. Biederman
2000-12-31  1:02             ` Andrea Arcangeli
2000-12-31  1:13               ` Chris Wedgwood
2000-12-31  1:50               ` Alexander Viro
2000-12-31  2:34                 ` Andrea Arcangeli
2000-12-31  2:09               ` Roman Zippel
2000-12-31  2:28                 ` Linus Torvalds
2000-12-31 12:58                   ` Roman Zippel
2001-04-21 20:06                     ` Races in affs_unlink(), affs_rmdir() and affs_rename() Alexander Viro
2001-04-21 22:16                       ` Roman Zippel
2001-04-22  5:53                         ` Alexander Viro
2001-04-22 12:57                           ` Roman Zippel
2001-04-22 13:15                             ` Alexander Viro
2000-12-31 14:38                   ` [RFC] Generic deferred file writing Andrea Arcangeli
2000-12-31 16:33                     ` Linus Torvalds
2000-12-31 16:50                       ` Andrea Arcangeli
2000-12-31 16:51                       ` Alexander Viro
2000-12-31 17:12                         ` Linus Torvalds
2000-12-31 18:30                   ` Daniel Phillips
2000-12-31 18:44                     ` Linus Torvalds
2000-12-31 19:10                       ` Daniel Phillips
2000-12-31 19:31                         ` Linus Torvalds
2000-12-31 21:03                       ` Roman Zippel
2000-12-31 21:32                         ` Linus Torvalds
2001-01-02 18:27                   ` Chris Mason [this message]
2000-12-30  3:08 ` test13-pre6 (Fork Bug with Athlons? Temporary Fix) Byron Stanoszek
2000-12-30  3:36   ` Linus Torvalds
2000-12-30  5:55     ` Andi Kleen
2000-12-30  5:13   ` Linus Torvalds
2000-12-30  8:13   ` Graham Murray
2000-12-30  4:21 ` test13-pre6 Dan Aloni
2001-01-04 20:23 ` test13-pre6 Stephen C. Tweedie
2001-01-04 22:15   ` test13-pre6 stewart
     [not found] <Pine.LNX.4.10.10012311726230.1671-100000@penguin.transmeta.com>
2001-01-01  2:50 ` [RFC] Generic deferred file writing Roman Zippel
2001-01-01  3:47   ` Alexander Viro
2001-01-01 12:44     ` Roman Zippel
2001-01-01 15:16       ` Alexander Viro
2001-01-02  3:00         ` Roman Zippel
2001-01-02  5:00           ` Alexander Viro
2001-01-02 16:53             ` Roman Zippel
2001-01-01 20:00     ` Daniel Phillips

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=138080000.978460026@tiny \
    --to=mason@suse.com \
    --cc=andrea@suse.de \
    --cc=ebiederman@uswest.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillips@innominate.de \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    --cc=zippel@fh-brandenburg.de \
    /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