FastWalk Dcache with 2.5.8 vs 2.5.10 dbench results
PATCH 1/1 FastWalk Dcache with 2.5.8 vs 2.5.10 dbench results
Here it is again...
This time I have a picture at http://prdownloads.sf.net/lse/2510.png
I ran dbench on an 8-way SMP with 1gb mem (no highmem). I used 1 to 12 clients each run was repeated 30 times. Then the highest and lowest values were removed and I took the average (dbench can be quite inconsistant). Let me know if you want to see the numbers.
Results show the fast_walk patch increases throughput.
Patch can also be downloaded at: http://prdownloads.sf.net/lse/fast_walkA1-2.5.10.patch
Hanna Linder
[email protected]
IBM Linux Technology Center
-------------
fs/dcache.c +10 -3
@@ -846,13 +846,22 @@struct dentry *d_lookup (struct dentry * parent,struct qstr * name) { +struct dentry * dentry; +spin_lock (&dcache_lock); + dentry =__d_lookup (parent,name); +spin_unlock (&dcache_lock); +return dentry; +} + +struct dentry *__d_lookup (struct dentry * parent,struct qstr * name) +{ +unsigned int len = name->len;unsigned int hash = name->hash;const unsigned char *str = name->name;struct list_head *head =d_hash (parent,hash);struct list_head *tmp; -spin_lock (&dcache_lock); tmp = head->next;for (;;) { struct dentry * dentry = list_entry(tmp, struct dentry, d_hash);
@@ -874,10 +883,8 @@ }__dget_locked (dentry); dentry->d_vfs_flags |=DCACHE_REFERENCED ; -spin_unlock (&dcache_lock);return dentry; } -spin_unlock (&dcache_lock);return NULL ; }
fs/namei.c +113 -6
199 lines not on this page · raw message
include/linux/dcache.h +1 -0
@@ -229,6 +229,7 @@/* appendix may either be NULL or be used for transname suffixes */ extern struct dentry *d_lookup (struct dentry *,struct qstr *); +extern struct dentry *__d_lookup (struct dentry *,struct qstr *);/* validate "insecure" dentry pointer */ extern int d_validate (struct dentry *,struct dentry *);
include/linux/fs.h +4 -7
@@ -1386,12 +1386,15 @@* - require a directory * - ending slashes ok even for nonexistent files * - internal "there are more path compnents" flag +* - locked when lookup done with dcache_lock held */ #define LOOKUP_FOLLOW (1)#define LOOKUP_DIRECTORY (2)#define LOOKUP_CONTINUE (4)#define LOOKUP_PARENT (16)#define LOOKUP_NOALT (32) +#define LOOKUP_LOCKED (64) +/* * Type of the last component on LOOKUP_PARENT */
@@ -1421,14 +1424,8 @@extern int FASTCALL (__user_walk (const char *,unsigned ,struct nameidata *));extern int FASTCALL (path_init (const char *,unsigned ,struct nameidata *));extern int FASTCALL (path_walk (const char *,struct nameidata *)); +extern int FASTCALL (path_lookup (const char *,unsigned ,struct nameidata *));extern int FASTCALL (link_path_walk (const char *,struct nameidata *)); -static inline int path_lookup (const char *path,unsigned flags,struct nameidata *nd) -{ -int error =0 ; -if (path_init (path, flags, nd)) - error =path_walk (path, nd); -return error; -}extern void path_release (struct nameidata *);extern int follow_down (struct vfsmount **,struct dentry **);extern int follow_up (struct vfsmount **,struct dentry **);