netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Andi Kleen <andi@firstfloor.org>
Cc: David Miller <davem@davemloft.net>,
	shemminger@linux-foundation.org, netdev@vger.kernel.org
Subject: Re: [ANN] Unified dynamic storage for different socket types instead of separate hash tables.
Date: Tue, 27 Mar 2007 17:35:33 +0400	[thread overview]
Message-ID: <20070327133532.GA24398@2ka.mipt.ru> (raw)
In-Reply-To: <p73bqie69ze.fsf@bingen.suse.de>

On Tue, Mar 27, 2007 at 04:23:49PM +0200, Andi Kleen (andi@firstfloor.org) wrote:
> > 2) An extra list insert/delete to give list of all sockets
> 
> That is currently limited by readlock on the hash buckets. I suspect
> any change to a trie with less atomic operations will make it faster.

The best case for trie is to attach a bitmask of used/free slots per
each trie node since it is based on arrays, so that list is not needed
at all. I thought about additional list of all sockets just because I
decided to not drop one of the hlist_node from sock_common, so it could
be reused for other purposes.
That hlist node is used for netlink broadcasting, but netlink case can 
be solved by moving sk_bind_node into private area and drop additional 
8/16 bytes from socket structure.

Trie nodes are protected through RCU, so it is possible to count
not-yet-freed socket as long as miss just-added ones.
I do not think this information can contain anyhow correct information,
since we have essentially the same problem with hash bucket locks -
until bucket is locked, we can not count for just-to-be-added sockets
and count those ones which will be dropped just after lock is released
in case removing function spins/waits for that bucket.

> -Andi

-- 
	Evgeniy Polyakov

      reply	other threads:[~2007-03-27 13:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 18:09 [ANN] Unified dynamic storage for different socket types instead of separate hash tables Evgeniy Polyakov
2007-03-22 18:43 ` Stephen Hemminger
2007-03-22 18:59   ` Evgeniy Polyakov
2007-03-22 19:03     ` David Miller
2007-03-22 19:09       ` Evgeniy Polyakov
2007-03-22 19:14         ` David Miller
2007-03-22 19:20           ` Evgeniy Polyakov
2007-03-22 19:14       ` Evgeniy Polyakov
2007-03-22 19:21         ` David Miller
2007-03-22 19:30           ` Evgeniy Polyakov
2007-03-22 19:36             ` David Miller
2007-03-22 19:40               ` Evgeniy Polyakov
2007-03-27 14:23           ` Andi Kleen
2007-03-27 13:35             ` Evgeniy Polyakov [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=20070327133532.GA24398@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=andi@firstfloor.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).