kernel_optimize_test/fs
Jens Axboe 18ce3751cc Properly notify block layer of sync writes
fsync_buffers_list() and sync_dirty_buffer() both issue async writes and
then immediately wait on them. Conceptually, that makes them sync writes
and we should treat them as such so that the IO schedulers can handle
them appropriately.

This patch fixes a write starvation issue that Lin Ming reported, where
xx is stuck for more than 2 minutes because of a large number of
synchronous IO in the system:

INFO: task kjournald:20558 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
message.
kjournald     D ffff810010820978  6712 20558      2
ffff81022ddb1d10 0000000000000046 ffff81022e7baa10 ffffffff803ba6f2
ffff81022ecd0000 ffff8101e6dc9160 ffff81022ecd0348 000000008048b6cb
0000000000000086 ffff81022c4e8d30 0000000000000000 ffffffff80247537
Call Trace:
[<ffffffff803ba6f2>] kobject_get+0x12/0x17
[<ffffffff80247537>] getnstimeofday+0x2f/0x83
[<ffffffff8029c1ac>] sync_buffer+0x0/0x3f
[<ffffffff8066d195>] io_schedule+0x5d/0x9f
[<ffffffff8029c1e7>] sync_buffer+0x3b/0x3f
[<ffffffff8066d3f0>] __wait_on_bit+0x40/0x6f
[<ffffffff8029c1ac>] sync_buffer+0x0/0x3f
[<ffffffff8066d48b>] out_of_line_wait_on_bit+0x6c/0x78
[<ffffffff80243909>] wake_bit_function+0x0/0x23
[<ffffffff8029e3ad>] sync_dirty_buffer+0x98/0xcb
[<ffffffff8030056b>] journal_commit_transaction+0x97d/0xcb6
[<ffffffff8023a676>] lock_timer_base+0x26/0x4b
[<ffffffff8030300a>] kjournald+0xc1/0x1fb
[<ffffffff802438db>] autoremove_wake_function+0x0/0x2e
[<ffffffff80302f49>] kjournald+0x0/0x1fb
[<ffffffff802437bb>] kthread+0x47/0x74
[<ffffffff8022de51>] schedule_tail+0x28/0x5d
[<ffffffff8020cac8>] child_rip+0xa/0x12
[<ffffffff80243774>] kthread+0x0/0x74
[<ffffffff8020cabe>] child_rip+0x0/0x12

Lin Ming confirms that this patch fixes the issue. I've run tests with
it for the past week and no ill effects have been observed, so I'm
proposing it for inclusion into 2.6.26.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-07-01 09:07:34 +02:00
..
9p
adfs
affs
afs Fix various old email addresses for dwmw2 2008-06-06 11:29:10 -07:00
autofs
autofs4
befs
bfs
cifs Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 2008-06-11 09:45:51 -07:00
coda
configfs
cramfs
debugfs
devpts
dlm
ecryptfs eCryptfs: remove unnecessary page decrypt call 2008-06-06 11:29:09 -07:00
efs
exportfs
ext2
ext3 ext3: fix online resize bug 2008-06-06 11:29:13 -07:00
ext4 Ext4: Fix online resize block group descriptor corruption 2008-06-20 11:48:48 -04:00
fat fat: relax the permission check of fat_setattr() 2008-06-12 18:05:39 -07:00
freevxfs
fuse fuse: fix thinko in max I/O size calucation 2008-06-17 18:08:10 -07:00
gfs2 [GFS2] fix gfs2 block allocation (cleaned up) 2008-06-24 19:02:28 +01:00
hfs
hfsplus
hostfs
hpfs
hppfs fix hppfs Makefile breakage 2008-05-21 16:55:58 -07:00
hugetlbfs
isofs
jbd
jbd2 jbd2: Fix barrier fallback code to re-lock the buffer head 2008-06-03 22:31:11 -04:00
jffs2
jfs
lockd
minix
msdos
ncpfs
nfs NFS: nfs_updatepage(): don't mark page as dirty if an error occurred 2008-06-23 17:09:07 -04:00
nfs_common
nfsd
nls
ntfs ntfs: le*_add_cpu conversion 2008-05-24 09:56:08 -07:00
ocfs2 ocfs2: Remove ->hangup() from stack glue operations. 2008-06-16 10:46:52 -07:00
openpromfs
partitions
proc pagemap: fix large pages in pagemap 2008-06-12 18:05:41 -07:00
qnx4
ramfs
reiserfs
romfs
smbfs
sysfs
sysv
udf udf: Fix regression in UDF anchor block detection 2008-06-24 11:38:03 +02:00
ufs
vfat
xfs [XFS] Fix memory corruption with small buffer reads 2008-05-23 18:12:49 +10:00
aio.c uml: activate_mm: remove the dead PF_BORROWED_MM check 2008-06-06 11:36:22 -07:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c nommu: fix ksize() abuse 2008-06-06 11:29:13 -07:00
binfmt_elf.c Remove last traces of a.out support from ELF loader. 2008-06-16 10:20:57 -07:00
binfmt_em86.c
binfmt_flat.c nommu: fix ksize() abuse 2008-06-06 11:29:13 -07:00
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c
block_dev.c [PATCH] fix cgroup-inflicted breakage in block_dev.c 2008-06-23 08:30:55 -04:00
buffer.c Properly notify block layer of sync writes 2008-07-01 09:07:34 +02:00
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c
compat.c
dcache.c [patch 2/3] vfs: dcache cleanups 2008-06-23 13:07:00 -04:00
dcookies.c
direct-io.c
dnotify.c
dquot.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c Include <asm/a.out.h> in fs/exec.c only for Alpha. 2008-06-16 10:20:57 -07:00
fcntl.c
fifo.c
file_table.c
file.c
filesystems.c
fs-writeback.c
generic_acl.c
inode.c
inotify_user.c
inotify.c
internal.h
ioctl.c
ioprio.c
Kconfig
Kconfig.binfmt frv: don't offer BINFMT_FLAT 2008-06-06 11:29:08 -07:00
libfs.c introduce memory_read_from_buffer() 2008-06-06 11:29:11 -07:00
locks.c [patch 4/4] flock: remove unused fields from file_lock_operations 2008-06-23 11:52:30 -04:00
Makefile
mbcache.c
mpage.c
namei.c [patch 3/4] vfs: fix ERR_PTR abuse in generic_readlink 2008-06-23 11:52:30 -04:00
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c [patch 1/4] vfs: path_{get,put}() cleanups 2008-06-23 11:52:29 -04:00
pnode.c
pnode.h
posix_acl.c
quota_v1.c
quota_v2.c
quota.c
read_write.c
read_write.h
readdir.c
select.c Fix performance regression on lmbench select benchmark 2008-06-22 12:23:15 -07:00
seq_file.c
signalfd.c
splice.c splice: handle try_to_release_page() failure 2008-05-28 14:49:27 +02:00
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c [patch for 2.6.26 4/4] vfs: utimensat(): fix write access check for futimens() 2008-06-23 08:43:52 -04:00
xattr_acl.c
xattr.c