* [PATCH 1/2] Make reiserfs default to barrier=flush
2006-08-04 13:51 [PATCH 0/2] enable write barriers by default Chris Mason
@ 2006-08-04 13:53 ` Chris Mason
2006-08-04 13:55 ` [PATCH 2/2] make ext3 mount default to barrier=1 Chris Mason
2006-08-05 3:39 ` [PATCH 0/2] enable write barriers by default Hans Reiser
2 siblings, 0 replies; 5+ messages in thread
From: Chris Mason @ 2006-08-04 13:53 UTC (permalink / raw)
To: linux-fsdevel; +Cc: akpm, reiserfs-dev
From: Chris Mason <mason@suse.com>
Subject: Make reiserfs default to barrier=flush
Change the default reiserfs mount option to barrier=flush
Signed-off-by: Chris Mason <mason@suse.com>
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1785,9 +1785,12 @@ static int reiserfs_fill_super(struct su
} else {
reiserfs_info(s, "using writeback data mode\n");
}
- if (reiserfs_barrier_flush(s)) {
+ /* make barrer=flush the default */
+
+ if (!reiserfs_barrier_none(s))
+ REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_BARRIER_FLUSH);
+ if (reiserfs_barrier_flush(s))
printk("reiserfs: using flush barriers\n");
- }
// set_device_ro(s->s_dev, 1) ;
if (journal_init(s, jdev_name, old_format, commit_max_age)) {
SWARN(silent, s,
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 2/2] make ext3 mount default to barrier=1
2006-08-04 13:51 [PATCH 0/2] enable write barriers by default Chris Mason
2006-08-04 13:53 ` [PATCH 1/2] Make reiserfs default to barrier=flush Chris Mason
@ 2006-08-04 13:55 ` Chris Mason
2006-08-05 3:39 ` [PATCH 0/2] enable write barriers by default Hans Reiser
2 siblings, 0 replies; 5+ messages in thread
From: Chris Mason @ 2006-08-04 13:55 UTC (permalink / raw)
To: linux-fsdevel; +Cc: akpm, reiserfs-dev
From: Chris Mason <mason@suse.com>
Subject: make ext3 mount default to barrier=1
This patch turns on barriers by default for ext3. mount -o barrier=0
will turn them off. It also changes the ext3 fsync call to trigger a
barrier when a commit isn't done.
Signed-off-by: Chris Mason <mason@suse.com>
--- a/fs/ext3/fsync.c Mon Feb 6 14:42:44 2006 -0500
+++ b/fs/ext3/fsync.c Mon Feb 6 14:43:14 2006 -0500
@@ -27,6 +27,7 @@
#include <linux/sched.h>
#include <linux/writeback.h>
#include <linux/jbd.h>
+#include <linux/blkdev.h>
#include <linux/ext3_fs.h>
#include <linux/ext3_jbd.h>
@@ -81,7 +82,10 @@ int ext3_sync_file(struct file * file, s
.sync_mode = WB_SYNC_ALL,
.nr_to_write = 0, /* sys_fsync did this */
};
+ journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;
ret = sync_inode(inode, &wbc);
+ if (journal && (journal->j_flags & JFS_BARRIER))
+ blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
}
out:
return ret;
diff -r b1d8075ee99b fs/ext3/super.c
--- a/fs/ext3/super.c Mon Feb 6 14:42:44 2006 -0500
+++ b/fs/ext3/super.c Mon Feb 6 14:43:14 2006 -0500
@@ -1423,6 +1423,8 @@ static int ext3_fill_super (struct super
sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
+ /* enable barriers by default */
+ set_opt(sbi->s_mount_opt, BARRIER);
set_opt(sbi->s_mount_opt, RESERVATION);
if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] enable write barriers by default
2006-08-04 13:51 [PATCH 0/2] enable write barriers by default Chris Mason
2006-08-04 13:53 ` [PATCH 1/2] Make reiserfs default to barrier=flush Chris Mason
2006-08-04 13:55 ` [PATCH 2/2] make ext3 mount default to barrier=1 Chris Mason
@ 2006-08-05 3:39 ` Hans Reiser
2006-08-05 12:45 ` Chris Mason
2 siblings, 1 reply; 5+ messages in thread
From: Hans Reiser @ 2006-08-05 3:39 UTC (permalink / raw)
To: Chris Mason; +Cc: linux-fsdevel, akpm, reiserfs-dev, Martin Steigerwald
Chris Mason wrote:
>Hello everyone,
>
>ReiserFS and ext3 have had code to support forcing cache flushes for a
>while, but it has been off by default.
>
>These two patches enable it by default on both filesystems. Disabling
>barriers can be done with:
>
>mount -o barrier=none in reiser
>mount -o barrier=0 in ext3
>
>-chris
>
>
>
>
>
Please explain when cache flushes occur now. For every fsync on a drive
that does not support write barriers? Which drives support it?
Did this only get enabled now because it is only now that someone from
the press is paying attention to it?
This is the price we paid for losing Andre, yes?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] enable write barriers by default
2006-08-05 3:39 ` [PATCH 0/2] enable write barriers by default Hans Reiser
@ 2006-08-05 12:45 ` Chris Mason
0 siblings, 0 replies; 5+ messages in thread
From: Chris Mason @ 2006-08-05 12:45 UTC (permalink / raw)
To: Hans Reiser; +Cc: linux-fsdevel, akpm, reiserfs-dev, Martin Steigerwald
On Fri, Aug 04, 2006 at 09:39:39PM -0600, Hans Reiser wrote:
>
> Please explain when cache flushes occur now.
Without them enabled? Never. With them enabled on every commit and/or
fsync.
> For every fsync on a drive
> that does not support write barriers? Which drives support it?
Most IDE and SATA drives.
>
> Did this only get enabled now because it is only now that someone from
> the press is paying attention to it?
No, it has been enabled by default in the SUSE kernels for a long time
(two enterprise releases now sles9 and sles10). I wanted to bring the
discussion about it into mainline.
>
> This is the price we paid for losing Andre, yes?
This is the price we pay for drives turning writeback cache on by
default. It happens for performance, because without tagging write
though caches give horrible write speeds. It is slower than not doing
IO (writeback cache) but faster than turning writeback caches off.
Exact benchmarks vary by drive, but it is never slower than
write-through caching, and almost always faster.
-chris
^ permalink raw reply [flat|nested] 5+ messages in thread