From: Eric Dumazet <[EMAIL PROTECTED]> Date: Mon, 30 Oct 2006 22:30:39 +0100
> In sock_attach_fd(), we are currently using > > d_add(file->f_dentry, SOCK_INODE(sock)); > > This has the effect to insert the dentry into the dentry_hashtable. > > I was wondering if it is really necessary : On a machine with many sockets, > the dentry_hashtable lookups may be slowed down for no good reason. (sockets > are not accessable by other means than socket() syscall, and not subject to > 'unuse and LRU freeable syndrom'). > > If we replace d_add(file->f_dentry, SOCK_INODE(sock)) call by > d_instantiate(file->f_dentry, SOCK_INODE(sock)), we also avoid using rcu > callback when socket is closed. (We would have to not provide a > d_op->d_delete > () method in sockfs_dentry_operations) Sounds like a useful optimization for sure. You can't mount sockfs on the filesystem, but they are visible via /proc/${pid}/fd/, I wonder if the dentry hashing is required just to make those nodes visible properly? - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html