aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authoralex chen <alex.chen@huawei.com>2015-02-10 17:09:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 17:30:29 -0500
commit1dfeb768475dfded66bba03a1744c2e8141d3429 (patch)
treea69b61304f134f9a6435261adeeabd90fbc4c34e /fs/ocfs2
parent15eba0fe3eeaeb1b80489c1ebb9d47d6d7003f57 (diff)
ocfs2: add a mount option journal_async_commit on ocfs2 filesystem
Add a mount option to support JBD2 feature: JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT. When this feature is opened, journal commit block can be written to disk without waiting for descriptor blocks, which can improve journal commit performance. This option will enable 'journal_checksum' internally. Using the fs_mark benchmark, using journal_async_commit shows a 50% improvement, the files per second go up from 215.2 to 317.5. test script: fs_mark -d /mnt/ocfs2/ -s 10240 -n 1000 default: FSUse% Count Size Files/sec App Overhead 0 1000 10240 215.2 17878 with journal_async_commit option: FSUse% Count Size Files/sec App Overhead 0 1000 10240 317.5 17881 Signed-off-by: Alex Chen <alex.chen@huawei.com> Signed-off-by: Weiwei Wang <wangww631@huawei.comm> Reviewed-by: Joseph Qi <joseph.qi@huawei.com> Reviewed-by: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/ocfs2.h2
-rw-r--r--fs/ocfs2/super.c17
2 files changed, 19 insertions, 0 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 7d6b7d090452..fdbcbfed529e 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -279,6 +279,8 @@ enum ocfs2_mount_options
279 writes */ 279 writes */
280 OCFS2_MOUNT_HB_NONE = 1 << 13, /* No heartbeat */ 280 OCFS2_MOUNT_HB_NONE = 1 << 13, /* No heartbeat */
281 OCFS2_MOUNT_HB_GLOBAL = 1 << 14, /* Global heartbeat */ 281 OCFS2_MOUNT_HB_GLOBAL = 1 << 14, /* Global heartbeat */
282
283 OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT = 1 << 15, /* Journal Async Commit */
282}; 284};
283 285
284#define OCFS2_OSB_SOFT_RO 0x0001 286#define OCFS2_OSB_SOFT_RO 0x0001
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 83723179e1ec..c09d6da23c3d 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -191,6 +191,7 @@ enum {
191 Opt_coherency_full, 191 Opt_coherency_full,
192 Opt_resv_level, 192 Opt_resv_level,
193 Opt_dir_resv_level, 193 Opt_dir_resv_level,
194 Opt_journal_async_commit,
194 Opt_err, 195 Opt_err,
195}; 196};
196 197
@@ -222,6 +223,7 @@ static const match_table_t tokens = {
222 {Opt_coherency_full, "coherency=full"}, 223 {Opt_coherency_full, "coherency=full"},
223 {Opt_resv_level, "resv_level=%u"}, 224 {Opt_resv_level, "resv_level=%u"},
224 {Opt_dir_resv_level, "dir_resv_level=%u"}, 225 {Opt_dir_resv_level, "dir_resv_level=%u"},
226 {Opt_journal_async_commit, "journal_async_commit"},
225 {Opt_err, NULL} 227 {Opt_err, NULL}
226}; 228};
227 229
@@ -1500,6 +1502,9 @@ static int ocfs2_parse_options(struct super_block *sb,
1500 option < OCFS2_MAX_RESV_LEVEL) 1502 option < OCFS2_MAX_RESV_LEVEL)
1501 mopt->dir_resv_level = option; 1503 mopt->dir_resv_level = option;
1502 break; 1504 break;
1505 case Opt_journal_async_commit:
1506 mopt->mount_opt |= OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT;
1507 break;
1503 default: 1508 default:
1504 mlog(ML_ERROR, 1509 mlog(ML_ERROR,
1505 "Unrecognized mount option \"%s\" " 1510 "Unrecognized mount option \"%s\" "
@@ -1606,6 +1611,9 @@ static int ocfs2_show_options(struct seq_file *s, struct dentry *root)
1606 if (osb->osb_dir_resv_level != osb->osb_resv_level) 1611 if (osb->osb_dir_resv_level != osb->osb_resv_level)
1607 seq_printf(s, ",dir_resv_level=%d", osb->osb_resv_level); 1612 seq_printf(s, ",dir_resv_level=%d", osb->osb_resv_level);
1608 1613
1614 if (opts & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
1615 seq_printf(s, ",journal_async_commit");
1616
1609 return 0; 1617 return 0;
1610} 1618}
1611 1619
@@ -2475,6 +2483,15 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)
2475 goto finally; 2483 goto finally;
2476 } 2484 }
2477 2485
2486 if (osb->s_mount_opt & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
2487 jbd2_journal_set_features(osb->journal->j_journal,
2488 JBD2_FEATURE_COMPAT_CHECKSUM, 0,
2489 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT);
2490 else
2491 jbd2_journal_clear_features(osb->journal->j_journal,
2492 JBD2_FEATURE_COMPAT_CHECKSUM, 0,
2493 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT);
2494
2478 if (dirty) { 2495 if (dirty) {
2479 /* recover my local alloc if we didn't unmount cleanly. */ 2496 /* recover my local alloc if we didn't unmount cleanly. */
2480 status = ocfs2_begin_local_alloc_recovery(osb, 2497 status = ocfs2_begin_local_alloc_recovery(osb,