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/extents.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/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 0917be51f102..743e3feb3e50 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -97,6 +97,8 @@ static int ext4_ext_journal_restart(handle_t *handle, int needed) | |||
97 | { | 97 | { |
98 | int err; | 98 | int err; |
99 | 99 | ||
100 | if (!ext4_handle_valid(handle)) | ||
101 | return 0; | ||
100 | if (handle->h_buffer_credits > needed) | 102 | if (handle->h_buffer_credits > needed) |
101 | return 0; | 103 | return 0; |
102 | err = ext4_journal_extend(handle, needed); | 104 | err = ext4_journal_extend(handle, needed); |
@@ -134,7 +136,7 @@ static int ext4_ext_dirty(handle_t *handle, struct inode *inode, | |||
134 | int err; | 136 | int err; |
135 | if (path->p_bh) { | 137 | if (path->p_bh) { |
136 | /* path points to block */ | 138 | /* path points to block */ |
137 | err = ext4_journal_dirty_metadata(handle, path->p_bh); | 139 | err = ext4_handle_dirty_metadata(handle, inode, path->p_bh); |
138 | } else { | 140 | } else { |
139 | /* path points to leaf/index in inode body */ | 141 | /* path points to leaf/index in inode body */ |
140 | err = ext4_mark_inode_dirty(handle, inode); | 142 | err = ext4_mark_inode_dirty(handle, inode); |
@@ -780,7 +782,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
780 | set_buffer_uptodate(bh); | 782 | set_buffer_uptodate(bh); |
781 | unlock_buffer(bh); | 783 | unlock_buffer(bh); |
782 | 784 | ||
783 | err = ext4_journal_dirty_metadata(handle, bh); | 785 | err = ext4_handle_dirty_metadata(handle, inode, bh); |
784 | if (err) | 786 | if (err) |
785 | goto cleanup; | 787 | goto cleanup; |
786 | brelse(bh); | 788 | brelse(bh); |
@@ -859,7 +861,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
859 | set_buffer_uptodate(bh); | 861 | set_buffer_uptodate(bh); |
860 | unlock_buffer(bh); | 862 | unlock_buffer(bh); |
861 | 863 | ||
862 | err = ext4_journal_dirty_metadata(handle, bh); | 864 | err = ext4_handle_dirty_metadata(handle, inode, bh); |
863 | if (err) | 865 | if (err) |
864 | goto cleanup; | 866 | goto cleanup; |
865 | brelse(bh); | 867 | brelse(bh); |
@@ -955,7 +957,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, | |||
955 | set_buffer_uptodate(bh); | 957 | set_buffer_uptodate(bh); |
956 | unlock_buffer(bh); | 958 | unlock_buffer(bh); |
957 | 959 | ||
958 | err = ext4_journal_dirty_metadata(handle, bh); | 960 | err = ext4_handle_dirty_metadata(handle, inode, bh); |
959 | if (err) | 961 | if (err) |
960 | goto out; | 962 | goto out; |
961 | 963 | ||
@@ -2947,7 +2949,7 @@ void ext4_ext_truncate(struct inode *inode) | |||
2947 | * transaction synchronous. | 2949 | * transaction synchronous. |
2948 | */ | 2950 | */ |
2949 | if (IS_SYNC(inode)) | 2951 | if (IS_SYNC(inode)) |
2950 | handle->h_sync = 1; | 2952 | ext4_handle_sync(handle); |
2951 | 2953 | ||
2952 | out_stop: | 2954 | out_stop: |
2953 | up_write(&EXT4_I(inode)->i_data_sem); | 2955 | up_write(&EXT4_I(inode)->i_data_sem); |