lkml.org 
[lkml]   [2002]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Avoid cache bounce in __d_lookup()
Date

__d_lookup() sets DCACHE_REFERENCED in d->d_vfs_flags. In the vast
majority of lookups, this bit will already be set. To avoid unecessary
writes, and unnecessarily dirtying and bouncing the cache line
containing d_vfs_flags (which depending on the architecture, can also
contain d_op, and parts of d_name and d_iname) this patch only sets the
bit if it wasn't already set.

d_vfs_flags itself seems a bit of a waste - the only bit used in it
currently is DCACHE_REFERENCED. It might be better to move it to part of
d_flags, which is also mostly unused for local filesystems. But d_flags
appears to be protected by the BKL, rather than the dcache_lock, so the
two sets of bits might be incompatible unless we switched to using
set_bit()/clear_bit() for d_flags.

--- linux-2.5.13/fs/dcache.c Thu May 2 17:22:42 2002
+++ linux-2.5.13-nodref/fs/dcache.c Sat May 4 16:36:38 2002
@@ -883,7 +883,8 @@
if (memcmp(dentry->d_name.name, str, len))
continue;
}
- dentry->d_vfs_flags |= DCACHE_REFERENCED;
+ if(!(dentry->d_vfs_flags & DCACHE_REFERENCED))
+ dentry->d_vfs_flags |= DCACHE_REFERENCED;
return dentry;
}
return NULL;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.044 / U:3.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site