lkml.org 
[lkml]   [2009]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [2/2] Optimize touch_time too
On Mon, Jul 06, 2009 at 09:24:47PM +0200, Andi Kleen wrote:
>
> Do a similar optimization as earlier for touch_atime. Getting
> the lock in mnt_get_write is relatively costly, so try all
> avenues to avoid it first.
>
> This patch is careful to still only update inode fields
> inside the lock region.
>
> This didn't show up in benchmarks, but it's easy enough
> to do.
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>
> ---
> fs/inode.c | 43 +++++++++++++++++++++++--------------------
> 1 file changed, 23 insertions(+), 20 deletions(-)
>
> Index: linux-2.6.31-rc1-ak/fs/inode.c
> ===================================================================
> --- linux-2.6.31-rc1-ak.orig/fs/inode.c
> +++ linux-2.6.31-rc1-ak/fs/inode.c
> @@ -1431,34 +1431,37 @@ void file_update_time(struct file *file)
> {
> struct inode *inode = file->f_path.dentry->d_inode;
> struct timespec now;
> - int sync_it = 0;
> - int err;
> + enum { S_MTIME = 1, S_CTIME = 2, S_VERSION = 4 } sync_it = 0;

Looks good, and makes sense to keep thise in sync with
file_update_atime.


\
 
 \ /
  Last update: 2009-07-07 12:53    [W:0.040 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site