linux/fs
Jeff Moyer 23aee091d8 dio: don't zero out the pages array inside struct dio
Intel reported a performance regression caused by the following commit:

commit 848c4dd515
Author: Zach Brown <zach.brown@oracle.com>
Date:   Mon Aug 20 17:12:01 2007 -0700

    dio: zero struct dio with kzalloc instead of manually

    This patch uses kzalloc to zero all of struct dio rather than
    manually trying to track which fields we rely on being zero.  It
    passed aio+dio stress testing and some bug regression testing on
    ext3.

    This patch was introduced by Linus in the conversation that lead up
    to Badari's minimal fix to manually zero .map_bh.b_state in commit:

      6a648fa721

    It makes the code a bit smaller.  Maybe a couple fewer cachelines to
    load, if we're lucky:

       text    data     bss     dec     hex filename
    3285925  568506 1304616 5159047  4eb887 vmlinux
    3285797  568506 1304616 5158919  4eb807 vmlinux.patched

    I was unable to measure a stable difference in the number of cpu
    cycles spent in blockdev_direct_IO() when pushing aio+dio 256K reads
    at ~340MB/s.

    So the resulting intent of the patch isn't a performance gain but to
    avoid exposing ourselves to the risk of finding another field like
    .map_bh.b_state where we rely on zeroing but don't enforce it in the
    code.

Zach surmised that zeroing out the page array was what caused most of
the problem, and suggested the approach taken in the attached patch for
resolving the issue.  Intel re-tested with this patch and saw a 0.6%
performance gain (the original regression was 0.5%).

[akpm@linux-foundation.org: add comment]
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Acked-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16 07:20:13 -08:00
..
9p
adfs
affs
afs
autofs
autofs4 autofs4: always use lookup for lookup 2009-12-16 07:19:58 -08:00
befs
bfs
btrfs task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
cachefiles tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
cifs
coda
configfs
cramfs
debugfs
devpts
dlm
ecryptfs
efs
exofs
exportfs
ext2 ext2: report metadata errors during fsync 2009-12-16 07:20:06 -08:00
ext3
ext4 tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
fat fatfs: use common time_to_tm in fat_time_unix2fat() 2009-12-16 07:20:06 -08:00
freevxfs
fscache FS-Cache: Avoid maybe-used-uninitialised warning on variable 2009-12-16 07:20:13 -08:00
fuse
gfs2 fs/gfs2/sys.c: use %pUB to print UUIDs 2009-12-15 08:53:33 -08:00
hfs hfs: fix a potential buffer overflow 2009-12-15 08:53:10 -08:00
hfsplus
hostfs
hpfs hpfs: use bitmap_weight() 2009-12-16 07:20:06 -08:00
hppfs
hugetlbfs
isofs
jbd task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
jbd2 task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
jffs2
jfs
lockd
minix
ncpfs
nfs Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2009-12-14 10:00:24 -08:00
nfs_common
nfsd
nilfs2 task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
nls
notify
ntfs
ocfs2
omfs
openpromfs
partitions
proc elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
qnx4
quota
ramfs
reiserfs reiserfs: don't compile procfs.o at all if no support 2009-12-16 07:20:06 -08:00
romfs
smbfs
squashfs
sysfs
sysv
ubifs fs/ubifs: use %pUB to print UUIDs 2009-12-15 08:53:33 -08:00
udf udf: Avoid IO in udf_clear_inode 2009-12-14 21:40:04 +01:00
ufs ufs: NFS support 2009-12-16 07:20:06 -08:00
xfs Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs 2009-12-15 09:12:43 -08:00
aio.c aio: remove unused field 2009-12-16 07:20:13 -08:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
binfmt_elf.c elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c
compat.c
dcache.c
dcookies.c
direct-io.c dio: don't zero out the pages array inside struct dio 2009-12-16 07:20:13 -08:00
drop_caches.c
eventfd.c
eventpoll.c
exec.c procfs: allow threads to rename siblings via /proc/pid/tasks/tid/comm 2009-12-15 08:53:24 -08:00
fcntl.c
fifo.c
file_table.c
file.c
filesystems.c
fs_struct.c
fs-writeback.c
generic_acl.c
inode.c
internal.h
ioctl.c
ioprio.c
Kconfig task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mpage.c
namei.c
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c
xattr_acl.c
xattr.c