]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: optimization for touch_atime()
authorAndi Kleen <andi@firstfloor.org>
Fri, 18 Sep 2009 20:05:47 +0000 (13:05 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 24 Sep 2009 11:47:26 +0000 (07:47 -0400)
commitb6d986563f7d2926f2cb9f63929e559e8cdb0c54
tree6b498fc08174b16b9fa1f44cce5d08d884eec49b
parenteec05304640d97d979f6ca76b9a7fa272a19d167
vfs: optimization for touch_atime()

Some benchmark testing shows touch_atime to be high up in profile logs for
IO intensive workloads.  Most likely that's due to the lock in
mnt_want_write().  Unfortunately touch_atime first takes the lock, and
then does all the other tests that could avoid atime updates (like noatime
or relatime).

Do it the other way round -- first try to avoid the update and only then
if that didn't succeed take the lock.  That works because none of the
atime avoidance tests rely on locking.

This also eliminates a goto.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Valerie Aurora <vaurora@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/inode.c