linux/fs/ext4
Hisashi Hifumi 53c550e975 ext4: fdatasync should skip metadata writeout when overwriting
Currently fdatasync is identical to fsync in ext3.

I think fdatasync should skip journal flush in data=ordered and
data=writeback mode when it overwrites to already-instantiated blocks on
HDD.  When I_DIRTY_DATASYNC flag is not set, fdatasync should skip journal
writeout because this indicates only atime or/and mtime updates.

Following patch is the same approach of ext2's fsync code(ext2_sync_file).

I did a performance test using the sysbench.

#sysbench --num-threads=128 --max-requests=50000 --test=fileio --file-total-size=128G
--file-test-mode=rndwr --file-fsync-mode=fdatasync run

The result on ext3 was:

	-2.6.24
	Operations performed:  0 Read, 50080 Write, 59600 Other = 109680 Total
	Read 0b  Written 782.5Mb  Total transferred 782.5Mb  (12.116Mb/sec)
	  775.45 Requests/sec executed

	Test execution summary:
	    total time:                          64.5814s
	    total number of events:              50080
	    total time taken by event execution: 3713.9836
	    per-request statistics:
	         min:                            0.0000s
	         avg:                            0.0742s
	         max:                            0.9375s
	         approx.  95 percentile:         0.2901s

	Threads fairness:
	    events (avg/stddev):           391.2500/23.26
	    execution time (avg/stddev):   29.0155/1.99

	-2.6.24-patched
	Operations performed:  0 Read, 50009 Write, 61596 Other = 111605 Total
	Read 0b  Written 781.39Mb  Total transferred 781.39Mb  (16.419Mb/sec)
	1050.83 Requests/sec executed

	Test execution summary:
	    total time:                          47.5900s
	    total number of events:              50009
	    total time taken by event execution: 2934.5768
	    per-request statistics:
 	         min:                            0.0000s
	         avg:                            0.0587s
 	         max:                            0.8938s
	         approx.  95 percentile:         0.1993s

	Threads fairness:
	    events (avg/stddev):           390.6953/22.64
	    execution time (avg/stddev):   22.9264/1.17

Filesystem I/O throughput was improved.

Signed-off-by :Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Acked-by: Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 10:38:59 -04:00
..
Makefile ext4: Add multi block allocator for ext4 2008-01-29 00:19:52 -05:00
acl.c Introduce is_owner_or_cap() to wrap CAP_FOWNER use with fsuid check 2007-07-17 12:00:03 -07:00
acl.h
balloc.c ext[234]: cleanup ext[234]_bg_num_gdb() 2008-02-06 10:41:21 -08:00
bitmap.c fs: mark nibblemap const 2007-10-17 08:42:47 -07:00
dir.c Remove incorrect BKL comments in ext4 2008-02-25 17:20:46 -05:00
ext4_jbd2.c [PATCH] ext4: uninline large functions 2006-12-07 08:39:35 -08:00
extents.c ext4: Don't mark filesystem error if fallocate fails 2008-02-25 15:41:35 -05:00
file.c ext4: store maxbytes for bitmapped files and return EFBIG as appropriate 2008-01-28 23:58:27 -05:00
fsync.c ext4: fdatasync should skip metadata writeout when overwriting 2008-04-17 10:38:59 -04:00
group.h ext4: add ext4_group_t, and change all group variables to this type. 2008-01-28 23:58:27 -05:00
hash.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ialloc.c ext*: spelling fix prefered -> preferred 2008-04-21 22:45:55 +00:00
inode.c ext*: spelling fix prefered -> preferred 2008-04-21 22:45:55 +00:00
ioctl.c [PATCH] r/o bind mounts: elevate write count for ioctls() 2008-04-19 00:29:24 -04:00
mballoc.c ext4: use non-racy method for proc entries creation 2008-04-29 08:06:20 -07:00
migrate.c ext4: Fix memory and buffer head leak in callers to ext4_ext_find_extent() 2008-02-25 16:54:37 -05:00
namei.c ext4: set EXT4_EXTENTS_FL only for directory and regular files 2008-02-25 16:38:03 -05:00
namei.h
resize.c ext4: add missing ext4_journal_stop() 2008-02-25 15:37:42 -05:00
super.c ext4: check return of ext4_orphan_get properly 2008-04-29 22:04:56 -04:00
symlink.c [PATCH] mark struct inode_operations const 1 2007-02-12 09:48:46 -08:00
xattr.c vfs: fix possible deadlock in ext2, ext3, ext4 when using xattrs 2008-04-15 19:35:41 -07:00
xattr.h ext4: Expand extra_inodes space per the s_{want,min}_extra_isize fields 2007-07-18 09:19:57 -04:00
xattr_security.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
xattr_trusted.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
xattr_user.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00