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/ialloc.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/ialloc.c')
-rw-r--r-- | fs/ext4/ialloc.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 6e6052879aa2..9dd21b75f4bc 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -253,12 +253,12 @@ void ext4_free_inode(handle_t *handle, struct inode *inode) | |||
253 | spin_unlock(sb_bgl_lock(sbi, flex_group)); | 253 | spin_unlock(sb_bgl_lock(sbi, flex_group)); |
254 | } | 254 | } |
255 | } | 255 | } |
256 | BUFFER_TRACE(bh2, "call ext4_journal_dirty_metadata"); | 256 | BUFFER_TRACE(bh2, "call ext4_handle_dirty_metadata"); |
257 | err = ext4_journal_dirty_metadata(handle, bh2); | 257 | err = ext4_handle_dirty_metadata(handle, NULL, bh2); |
258 | if (!fatal) fatal = err; | 258 | if (!fatal) fatal = err; |
259 | } | 259 | } |
260 | BUFFER_TRACE(bitmap_bh, "call ext4_journal_dirty_metadata"); | 260 | BUFFER_TRACE(bitmap_bh, "call ext4_handle_dirty_metadata"); |
261 | err = ext4_journal_dirty_metadata(handle, bitmap_bh); | 261 | err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh); |
262 | if (!fatal) | 262 | if (!fatal) |
263 | fatal = err; | 263 | fatal = err; |
264 | sb->s_dirt = 1; | 264 | sb->s_dirt = 1; |
@@ -656,15 +656,16 @@ repeat_in_this_group: | |||
656 | ino, bitmap_bh->b_data)) { | 656 | ino, bitmap_bh->b_data)) { |
657 | /* we won it */ | 657 | /* we won it */ |
658 | BUFFER_TRACE(bitmap_bh, | 658 | BUFFER_TRACE(bitmap_bh, |
659 | "call ext4_journal_dirty_metadata"); | 659 | "call ext4_handle_dirty_metadata"); |
660 | err = ext4_journal_dirty_metadata(handle, | 660 | err = ext4_handle_dirty_metadata(handle, |
661 | inode, | ||
661 | bitmap_bh); | 662 | bitmap_bh); |
662 | if (err) | 663 | if (err) |
663 | goto fail; | 664 | goto fail; |
664 | goto got; | 665 | goto got; |
665 | } | 666 | } |
666 | /* we lost it */ | 667 | /* we lost it */ |
667 | jbd2_journal_release_buffer(handle, bitmap_bh); | 668 | ext4_handle_release_buffer(handle, bitmap_bh); |
668 | 669 | ||
669 | if (++ino < EXT4_INODES_PER_GROUP(sb)) | 670 | if (++ino < EXT4_INODES_PER_GROUP(sb)) |
670 | goto repeat_in_this_group; | 671 | goto repeat_in_this_group; |
@@ -726,7 +727,8 @@ got: | |||
726 | /* Don't need to dirty bitmap block if we didn't change it */ | 727 | /* Don't need to dirty bitmap block if we didn't change it */ |
727 | if (free) { | 728 | if (free) { |
728 | BUFFER_TRACE(block_bh, "dirty block bitmap"); | 729 | BUFFER_TRACE(block_bh, "dirty block bitmap"); |
729 | err = ext4_journal_dirty_metadata(handle, block_bh); | 730 | err = ext4_handle_dirty_metadata(handle, |
731 | NULL, block_bh); | ||
730 | } | 732 | } |
731 | 733 | ||
732 | brelse(block_bh); | 734 | brelse(block_bh); |
@@ -771,8 +773,8 @@ got: | |||
771 | } | 773 | } |
772 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp); | 774 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp); |
773 | spin_unlock(sb_bgl_lock(sbi, group)); | 775 | spin_unlock(sb_bgl_lock(sbi, group)); |
774 | BUFFER_TRACE(bh2, "call ext4_journal_dirty_metadata"); | 776 | BUFFER_TRACE(bh2, "call ext4_handle_dirty_metadata"); |
775 | err = ext4_journal_dirty_metadata(handle, bh2); | 777 | err = ext4_handle_dirty_metadata(handle, NULL, bh2); |
776 | if (err) goto fail; | 778 | if (err) goto fail; |
777 | 779 | ||
778 | percpu_counter_dec(&sbi->s_freeinodes_counter); | 780 | percpu_counter_dec(&sbi->s_freeinodes_counter); |
@@ -825,7 +827,7 @@ got: | |||
825 | 827 | ||
826 | ext4_set_inode_flags(inode); | 828 | ext4_set_inode_flags(inode); |
827 | if (IS_DIRSYNC(inode)) | 829 | if (IS_DIRSYNC(inode)) |
828 | handle->h_sync = 1; | 830 | ext4_handle_sync(handle); |
829 | if (insert_inode_locked(inode) < 0) { | 831 | if (insert_inode_locked(inode) < 0) { |
830 | err = -EINVAL; | 832 | err = -EINVAL; |
831 | goto fail_drop; | 833 | goto fail_drop; |
@@ -1028,4 +1030,3 @@ unsigned long ext4_count_dirs(struct super_block * sb) | |||
1028 | } | 1030 | } |
1029 | return count; | 1031 | return count; |
1030 | } | 1032 | } |
1031 | |||