kernel-ark/fs
Eric Dumazet 163da958ba [PATCH] FS: speed up rw_verify_area()
oprofile hunting showed a stall in rw_verify_area(), because of triple
indirection and potential cache misses.
(file->f_path.dentry->d_inode->i_flock)

By moving initialization of 'struct inode' pointer before the pos/count
sanity tests, we allow the compiler and processor to perform two loads by
anticipation, reducing stall, without prefetch() hints.  Even x86 arch has
enough registers to not use temporary variables and not increase text size.

I validated this patch running a bench and studied oprofile changes, and
absolute perf of the test program.

Results of my epoll_pipe_bench (source available on request) on a Pentium-M
1.6 GHz machine

Before :
# ./epoll_pipe_bench -l 30 -t 20
Avg: 436089 evts/sec read_count=8843037 write_count=8843040 21.218390 samples
per call
(best value out of 10 runs)

After :
# ./epoll_pipe_bench -l 30 -t 20
Avg: 470980 evts/sec read_count=9549871 write_count=9549894 21.216694 samples
per call
(best value out of 10 runs)

oprofile CPU_CLK_UNHALTED events gave a reduction from 5.3401 % to 2.5851 %
for the rw_verify_area() function.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12 09:48:29 -08:00
..
9p [PATCH] remove invalidate_inode_pages() 2007-02-11 10:51:31 -08:00
adfs [PATCH] adfs: fix filename handling 2007-01-05 23:55:22 -08:00
affs
afs
autofs
autofs4 [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
befs [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
bfs [PATCH] update Tigran's email addresses 2006-12-13 09:05:53 -08:00
cifs [CIFS] Minor cleanup 2007-02-06 20:43:30 +00:00
coda [PATCH] seq_file conversion: coda 2007-02-11 10:51:34 -08:00
configfs [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
cramfs
debugfs DebugFS : file/directory removal fix 2006-12-13 15:38:45 -08:00
devpts
dlm [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
ecryptfs [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
efs
exportfs
ext2 [PATCH] fix umask when noACL kernel meets extN tuned for ACLs 2007-02-11 10:51:34 -08:00
ext3 [PATCH] jbd layer function called instead of fs specific one 2007-02-11 11:18:06 -08:00
ext4 [PATCH] jbd layer function called instead of fs specific one 2007-02-11 11:18:06 -08:00
fat
freevxfs
fuse [PATCH] remove invalidate_inode_pages() 2007-02-11 10:51:31 -08:00
gfs2 [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
hfs [PATCH] extend the set of "__attribute__" shortcut macros 2007-02-11 10:51:35 -08:00
hfsplus [PATCH] extend the set of "__attribute__" shortcut macros 2007-02-11 10:51:35 -08:00
hostfs [PATCH] uml: fix mknod 2007-01-30 08:26:44 -08:00
hpfs
hppfs
hugetlbfs [PATCH] hugetlb: preserve hugetlb pte dirty state 2007-02-09 09:25:46 -08:00
isofs
jbd [PATCH] jbd: wait for already submitted t_sync_datalist buffer to complete 2006-12-22 08:55:51 -08:00
jbd2
jffs [PATCH] remove invalidate_inode_pages() 2007-02-11 10:51:31 -08:00
jffs2 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2007-01-18 10:34:51 +11:00
jfs JFS: Remove incorrect kgdb define 2007-01-26 10:14:36 -06:00
lockd [PATCH] fs/lockd/clntlock.c: add missing newlines to dprintk's 2007-01-30 08:26:45 -08:00
minix
msdos
ncpfs [PATCH] ncpfs: ensure we free wdog_pid on parse_option or fill_inode failure 2006-12-13 09:05:53 -08:00
nfs [PATCH] Remove warning: VFS is out of sync with lock manager 2007-01-30 16:01:35 -08:00
nfs_common
nfsd [PATCH] endianness bug: ntohl() misspelled as >> 24 in fh_verify(). 2007-02-01 16:17:06 -08:00
nls
ntfs [PATCH] NTFS: rename incorrect check of NTFS_DEBUG with just DEBUG 2007-02-12 09:48:27 -08:00
ocfs2 [PATCH] ocfs2 heartbeat: clean up bio submission code 2007-02-07 12:15:58 -08:00
openpromfs
partitions Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 2007-02-11 11:37:45 -08:00
proc [PATCH] ifdef ->rchar, ->wchar, ->syscr, ->syscw from task_struct 2007-02-11 11:18:07 -08:00
qnx4
ramfs [PATCH] convert ramfs to use __set_page_dirty_no_writeback 2007-02-11 10:51:19 -08:00
reiserfs [PATCH] reiserfs: Use ARRAY_SIZE macro when appropriate 2007-02-12 09:48:29 -08:00
romfs
smbfs [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
sysfs [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
sysv [PATCH] fs/sysv/: proper prototypes for 2 functions 2006-12-22 08:55:47 -08:00
udf
ufs [PATCH] ufs: restore back support of openstep 2007-02-09 09:25:46 -08:00
vfat
xfs [PATCH] Make XFS use BH_Unwritten and BH_Delay correctly 2007-02-12 09:48:27 -08:00
aio.c [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
attr.c
bad_inode.c [PATCH] fix memory corruption from misinterpreted bad_inode_ops return values 2007-01-05 23:55:23 -08:00
binfmt_aout.c
binfmt_elf_fdpic.c [PATCH] Remove final references to deprecated "MAP_ANON" page protection flag 2007-02-11 10:51:17 -08:00
binfmt_elf.c [PATCH] core-dumping unreadable binaries via PT_INTERP 2007-01-26 13:51:00 -08:00
binfmt_em86.c
binfmt_flat.c [PATCH] uclinux: correctly remap bin_fmtflat exe allocated mem regions 2007-02-09 10:45:33 -08:00
binfmt_misc.c [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
binfmt_script.c
binfmt_som.c
bio.c [PATCH] optimize o_direct on block devices 2006-12-13 09:05:50 -08:00
block_dev.c [PATCH] revert blockdev direct io back to 2.6.19 version 2007-02-03 11:26:06 -08:00
buffer.c [PATCH] warning fix: unsigned->signed 2007-02-12 09:48:29 -08:00
char_dev.c [PATCH] register_chrdev_region() don't hand out the LOCAL/EXPERIMENTAL majors 2007-02-12 09:48:27 -08:00
compat_ioctl.c
compat.c [PATCH] fdtable: Make fdarray and fdsets equal in size 2006-12-10 09:57:22 -08:00
dcache.c [PATCH] Fix d_path for lazy unmounts 2007-02-12 09:48:27 -08:00
dcookies.c
direct-io.c [PATCH] dio: lock refcount operations 2006-12-10 09:57:21 -08:00
dnotify.c
dquot.c [PATCH] remove sb->s_files and file_list_lock usage in dquot.c 2007-02-12 09:48:28 -08:00
drop_caches.c [PATCH] remove invalidate_inode_pages() 2007-02-11 10:51:31 -08:00
eventpoll.c
exec.c [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
fcntl.c [PATCH] fdtable: Make fdarray and fdsets equal in size 2006-12-10 09:57:22 -08:00
fifo.c
file_table.c
file.c [PATCH] fdtable: Provide free_fdtable() wrapper 2006-12-22 08:55:50 -08:00
filesystems.c
fs-writeback.c Write back inode data pages even when the inode itself is locked 2007-01-26 12:53:20 -08:00
generic_acl.c
inode.c [PATCH] move remove_dquot_ref to dqout.c 2007-02-12 09:48:28 -08:00
inotify_user.c [PATCH] inotify: read return val fix 2007-02-12 09:48:28 -08:00
inotify.c
internal.h
ioctl.c
ioprio.c
Kconfig [PATCH] Remove unused kernel config option ZISOFS_FS 2007-02-11 11:18:06 -08:00
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mpage.c
namei.c
namespace.c [PATCH] Transform kmem_cache_alloc()+memset(0) -> kmem_cache_zalloc(). 2007-02-11 10:51:27 -08:00
nfsctl.c
no-block.c
open.c [PATCH] fdtable: Make fdarray and fdsets equal in size 2006-12-10 09:57:22 -08:00
pipe.c [PATCH] fix leaks on pipe(2) failure exits 2006-12-21 00:16:03 -08:00
pnode.c
pnode.h
posix_acl.c
quota_v1.c
quota_v2.c
quota.c
read_write.c [PATCH] FS: speed up rw_verify_area() 2007-02-12 09:48:29 -08:00
read_write.h
readdir.c
select.c [PATCH] fdtable: Make fdarray and fdsets equal in size 2006-12-10 09:57:22 -08:00
seq_file.c
splice.c [PATCH] constify pipe_buf_operations 2006-12-13 09:05:47 -08:00
stack.c [PATCH] fsstack: Remove inode copy 2006-12-22 08:55:48 -08:00
stat.c
super.c [PATCH] Revert bd_mount_mutex back to a semaphore 2007-01-11 18:18:21 -08:00
sync.c
utimes.c
xattr_acl.c
xattr.c