On Wednesday 07 March 2007 18:45, Linus Torvalds wrote:
Yes, but mntget()/mntput() are protected against NULL.
I was quite happy to remove two locked operations :)
I didnt found a way to crash (yet) my patched machine :)
I tried this path today and failed...
Too many changes to do (nameidata) to propagate a 'struct file *'
appropriately...
OK no problem here is the patch without messing f_path.mnt
(benchmark results not really different on my little machine, SMP kernel but
one CPU only... maybe because lock suffix is changed by a nop)
[PATCH] Delay the dentry name generation on sockets and pipes.
1) Introduces a new method in 'struct dentry_operations'. This method called
d_dname() might be called from d_path() to be able to provide a dentry name
for special filesystems. It is called without locks.
Future patches (if we succeed in having one common dentry for all pipes) may
need to change prototype of this method, but we now use :
char *d_dname(struct dentry *dentry, char *buffer, int buflen)
2) Use this new method for sockets : No more sprintf() at socket creation.
This is delayed up to the moment someone does an access to /proc/pid/fd/...
3) Use this new method for pipes : No more sprintf() at pipe creation. This is
delayed up to the moment someone does an access to /proc/pid/fd/...
A benchmark consisting of 1.000.000 calls to pipe()/close()/close() gives a
*nice* speedup on my Pentium(M) 1.6 Ghz :
3.090 s instead of 3.450 s
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
fs/dcache.c | 3 +++
fs/pipe.c | 12 +++++++++---
include/linux/dcache.h | 1 +
net/socket.c | 13 ++++++++++---
4 files changed, 23 insertions(+), 6 deletions(-)