All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dada1@cosmosbay.com
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] Any strong reason why socket dentries are hashed in global d_hash table ?
Date: Mon, 30 Oct 2006 14:15:27 -0800 (PST)	[thread overview]
Message-ID: <20061030.141527.74717587.davem@davemloft.net> (raw)
In-Reply-To: <45466EFF.5060108@cosmosbay.com>

From: Eric Dumazet <dada1@cosmosbay.com>
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?

      reply	other threads:[~2006-10-30 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-29 21:24 [PATCH] DCCP: fix printk format warnings Randy Dunlap
2006-10-30  0:04 ` David Miller
2006-10-30 21:30   ` [RFC] Any strong reason why socket dentries are hashed in global d_hash table ? Eric Dumazet
2006-10-30 22:15     ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061030.141527.74717587.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dada1@cosmosbay.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.