public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: New disk format and fsync optimizations pushed out
Date: Fri, 05 Sep 2008 16:35:41 -0400	[thread overview]
Message-ID: <1220646941.8075.98.camel@think.oraclecorp.com> (raw)

Hello everyone,

I've pushed out my work to optimize file and directory fsyncs (as well
as O_SYNC writes).  It includes a new disk format.

I'll post some benchmarks next week, but in general this should be much
more usable in mail server workloads.  Details on how it all works can
be found in tree-log.c comments.

The short version is that instead of an fsync doing a full FS commit,
items for a given file or directory that have been changed by the
current transaction are copied into a log tree.

This log tree uses the same copy on write code as all the other trees in
the FS, but the super block has pointers to a tree of log tree roots,
and synchronous FS ops are changed to write an updated super block with
just the pointer to the log trees modified.

After a crash, items and extent pointers are copied out of the log tree
back into the main FS.

The end result is that fsyncs don't commit the extent tree or force a
recow of any subvolume tree blocks, which is what made them so expensive
in the old code.

fsyncs in one subvolume don't force other subvolumes to flush all of
their blocks to disk.  fsyncs in one file don't force any other files or
directories down to disk.  In other words, it makes the impact of an
fsync much smaller in every workload.

Blocks for the log tree come out of the metadata block groups.  So they
have the same raid levels and duplication rules as the rest of the
metadata.

-chris



                 reply	other threads:[~2008-09-05 20:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1220646941.8075.98.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox