public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@innominate.de>
To: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [RFC] Generic deferred file writing
Date: Sun, 31 Dec 2000 19:30:29 +0100	[thread overview]
Message-ID: <3A4F7B45.C8313E8A@innominate.de> (raw)
In-Reply-To: <Pine.GSO.4.10.10012310241300.8887-100000@zeus.fh-brandenburg.de> <Pine.LNX.4.10.10012301816410.1743-100000@penguin.transmeta.com>

Linus Torvalds 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().

It's not that hard or inefficient to return the ENOSPC from the usual
point.  For example, make a gross overestimate of the space needed for
the write, compare to a cached filesystem free space value less the
amount deferred so far, and fail to take the optimization if it looks
even close.  Also, it's not necessarily bad to defer the ENOSPC to file
close time.  The same thing can happen with failed disk io, and that's
just a fact of life with asynchronous io.  A reliable program needs to
be able to deal with it.  (I think there was a long thread on this not
long ago, regarding filesystem errors returned after a program exits.)

>  - 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.

Another nicety is not having to bother the filesystem at all about
sequences of short writes.

> The second point is completely different, and THIS is where I think there
> are potentially real advantages. However, I also think that this is not
> actually about deferred writes at all: it's really a question of the
> filesystem having access to the page when the physical write is actually
> started so that the filesystem might choose to _change_ the allocation it
> did - it might have allocated a backing store block at "get_block()" time,
> but by the time it actually writes the stuff out to disk it may have
> allocated a bigger contiguous area somewhere else for the data..

You'd most likely be able to measure the overhead under load of doing
the allocation twice, due to the occasional need to read back a
swapped-out metadata block.

XFS does deferred allocation and the Reiser guys are talking about it -
it seems to be something worth doing.  For me the question is, if the
VFS can already do the deferring, is there a good reason for a
filesystem to duplicate that functionality?

--
Daniel
-
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:[~2000-12-31 19:03 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 [this message]
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
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=3A4F7B45.C8313E8A@innominate.de \
    --to=phillips@innominate.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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