diff options
author | Frank Mayhar <fmayhar@google.com> | 2009-01-07 00:06:22 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-01-07 00:06:22 -0500 |
commit | 0390131ba84fd3f726f9e24fc4553828125700bb (patch) | |
tree | 4c90afad4e8690e25aec0ce069fd450e92ab5f96 /fs/ext4/xattr.c | |
parent | ff7ef329b268b603ea4a2303241ef1c3829fd574 (diff) |
ext4: Allow ext4 to run without a journal
A few weeks ago I posted a patch for discussion that allowed ext4 to run
without a journal. Since that time I've integrated the excellent
comments from Andreas and fixed several serious bugs. We're currently
running with this patch and generating some performance numbers against
both ext2 (with backported reservations code) and ext4 with and without
a journal. It just so happens that running without a journal is
slightly faster for most everything.
We did
iozone -T -t 4 s 2g -r 256k -T -I -i0 -i1 -i2
which creates 4 threads, each of which create and do reads and writes on
a 2G file, with a buffer size of 256K, using O_DIRECT for all file opens
to bypass the page cache. Results:
ext2 ext4, default ext4, no journal
initial writes 13.0 MB/s 15.4 MB/s 15.7 MB/s
rewrites 13.1 MB/s 15.6 MB/s 15.9 MB/s
reads 15.2 MB/s 16.9 MB/s 17.2 MB/s
re-reads 15.3 MB/s 16.9 MB/s 17.2 MB/s
random readers 5.6 MB/s 5.6 MB/s 5.7 MB/s
random writers 5.1 MB/s 5.3 MB/s 5.4 MB/s
So it seems that, so far, this was a useful exercise.
Signed-off-by: Frank Mayhar <fmayhar@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 9b4a368c5728..157ce6589c54 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -457,7 +457,7 @@ static void ext4_xattr_update_super_block(handle_t *handle, | |||
457 | if (ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh) == 0) { | 457 | if (ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh) == 0) { |
458 | EXT4_SET_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR); | 458 | EXT4_SET_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR); |
459 | sb->s_dirt = 1; | 459 | sb->s_dirt = 1; |
460 | ext4_journal_dirty_metadata(handle, EXT4_SB(sb)->s_sbh); | 460 | ext4_handle_dirty_metadata(handle, NULL, EXT4_SB(sb)->s_sbh); |
461 | } | 461 | } |
462 | } | 462 | } |
463 | 463 | ||
@@ -487,9 +487,9 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode, | |||
487 | ext4_forget(handle, 1, inode, bh, bh->b_blocknr); | 487 | ext4_forget(handle, 1, inode, bh, bh->b_blocknr); |
488 | } else { | 488 | } else { |
489 | le32_add_cpu(&BHDR(bh)->h_refcount, -1); | 489 | le32_add_cpu(&BHDR(bh)->h_refcount, -1); |
490 | error = ext4_journal_dirty_metadata(handle, bh); | 490 | error = ext4_handle_dirty_metadata(handle, inode, bh); |
491 | if (IS_SYNC(inode)) | 491 | if (IS_SYNC(inode)) |
492 | handle->h_sync = 1; | 492 | ext4_handle_sync(handle); |
493 | DQUOT_FREE_BLOCK(inode, 1); | 493 | DQUOT_FREE_BLOCK(inode, 1); |
494 | ea_bdebug(bh, "refcount now=%d; releasing", | 494 | ea_bdebug(bh, "refcount now=%d; releasing", |
495 | le32_to_cpu(BHDR(bh)->h_refcount)); | 495 | le32_to_cpu(BHDR(bh)->h_refcount)); |
@@ -724,8 +724,9 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, | |||
724 | if (error == -EIO) | 724 | if (error == -EIO) |
725 | goto bad_block; | 725 | goto bad_block; |
726 | if (!error) | 726 | if (!error) |
727 | error = ext4_journal_dirty_metadata(handle, | 727 | error = ext4_handle_dirty_metadata(handle, |
728 | bs->bh); | 728 | inode, |
729 | bs->bh); | ||
729 | if (error) | 730 | if (error) |
730 | goto cleanup; | 731 | goto cleanup; |
731 | goto inserted; | 732 | goto inserted; |
@@ -794,8 +795,9 @@ inserted: | |||
794 | ea_bdebug(new_bh, "reusing; refcount now=%d", | 795 | ea_bdebug(new_bh, "reusing; refcount now=%d", |
795 | le32_to_cpu(BHDR(new_bh)->h_refcount)); | 796 | le32_to_cpu(BHDR(new_bh)->h_refcount)); |
796 | unlock_buffer(new_bh); | 797 | unlock_buffer(new_bh); |
797 | error = ext4_journal_dirty_metadata(handle, | 798 | error = ext4_handle_dirty_metadata(handle, |
798 | new_bh); | 799 | inode, |
800 | new_bh); | ||
799 | if (error) | 801 | if (error) |
800 | goto cleanup_dquot; | 802 | goto cleanup_dquot; |
801 | } | 803 | } |
@@ -833,7 +835,8 @@ getblk_failed: | |||
833 | set_buffer_uptodate(new_bh); | 835 | set_buffer_uptodate(new_bh); |
834 | unlock_buffer(new_bh); | 836 | unlock_buffer(new_bh); |
835 | ext4_xattr_cache_insert(new_bh); | 837 | ext4_xattr_cache_insert(new_bh); |
836 | error = ext4_journal_dirty_metadata(handle, new_bh); | 838 | error = ext4_handle_dirty_metadata(handle, |
839 | inode, new_bh); | ||
837 | if (error) | 840 | if (error) |
838 | goto cleanup; | 841 | goto cleanup; |
839 | } | 842 | } |
@@ -1040,7 +1043,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, | |||
1040 | */ | 1043 | */ |
1041 | is.iloc.bh = NULL; | 1044 | is.iloc.bh = NULL; |
1042 | if (IS_SYNC(inode)) | 1045 | if (IS_SYNC(inode)) |
1043 | handle->h_sync = 1; | 1046 | ext4_handle_sync(handle); |
1044 | } | 1047 | } |
1045 | 1048 | ||
1046 | cleanup: | 1049 | cleanup: |