[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45EE66BE.8020003@cosmosbay.com>
Date: Wed, 07 Mar 2007 08:16:14 +0100
From: Eric Dumazet <dada1@...mosbay.com>
To: Eric Dumazet <dada1@...mosbay.com>
CC: Linus Torvalds <torvalds@...ux-foundation.org>,
Davide Libenzi <davidel@...ilserver.org>,
Avi Kivity <avi@...o.co.il>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...IV.linux.org.uk>
Subject: Re: [patch] epoll use a single inode ...
Eric Dumazet a écrit :
>
> I would definitly *love* saving dentries for pipes (and sockets too),
> but how are you going to get the inode ?
>
> pipes()/sockets() can use read()/write()/rw_verify_area() and thus need
> file->f_path.dentry->d_inode (so each pipe needs a separate dentry)
>
> Are you suggesting adding a new "struct file_operations" member to get
> the inode ?
> Or re-intoducing an inode pointer in struct file ?
Crazy ideas : (some readers are going to kill me)
1) Use the low order bit of f_path.dentry to say : this pointer is not a
pointer to a dentry but the inode pointer (with the low order bit set to 1)
OR
2) file->f_path.dentry set to NULL for this special files (so that we dont
need to dput() and cache line ping pong the common dentry each time we
__fput() a pipe/socket.
Same trick could be used for file->f_path.mnt, because there is a big SMP
cache line ping/pong to maintain a mnt_count on pipe/sockets mountpoint while
these file systems cannot be un-mounted)
If dentry is NULL, we get the inode pointer from an overlay of struct
file_ra_state f_ra; (because for this special files readahead is unused)
This adds some conditional branches of course, but being able to save ram and
better use cpu caches might be worth them.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists