From: David Miller <davem@davemloft.net>
To: xiaosuo@gmail.com
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org
Subject: Re: inetpeer with create==0
Date: Wed, 02 Mar 2011 22:42:20 -0800 (PST) [thread overview]
Message-ID: <20110302.224220.179921025.davem@davemloft.net> (raw)
In-Reply-To: <AANLkTi=Ty+C3b9U+151dUMpgGiwG3AE4dMmc3djWmp6v@mail.gmail.com>
From: Changli Gao <xiaosuo@gmail.com>
Date: Thu, 3 Mar 2011 14:27:40 +0800
> On Thu, Mar 3, 2011 at 1:36 PM, David Miller <davem@davemloft.net> wrote:
>>
>> Because trie eliminates all of the issues of having to size a hash
>> table, dynamically resize it, etc.
>>
>> Trie gives well bounded performance dependent solely upon size of
>> the table, rather than access patterns, distribution of keys, and
>> how perfect hash function is.
>
> Thanks for your explaination. Routing cache has all of these issues. :)
Thats why I am working hard to remove it :-)
The %99 percentile performance of our routing cache is absolutely
terrible. The routing cache does nothing except get in the way.
It is the reason why Linux is still completely unsuitable for use as a
router on the core internet.
> Radix tree may cost lots of memory than a rbtree, avl tree or hash
> table. Here is a case: turning to rbtree from radix tree.
> http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commit;h=8549164143a5431f9d9ea846acaa35a862410d9c
I would not be against the use of rbtree or similar if it could be
done with with fully RCU non-locked lookups even in the not-present
case.
> Hash table + jhash have been proven a safe and efficient data
> structure for large data sets(conntrack and ipvs), although the size
> of the hash table may have to be adjusted by an administrator.
If anything is proven, it is that hashing based collections of cached
information are nothing but trouble when the contents are controlled in
some way by external entities.
Actually, back to the original topic, I wonder how bad it is to simply
elide the recheck in the create==0 case anyways. Except for the ipv4
fragmentation wraparound protection values, perfect inetpeer finding
is not necessary for correctness. And IPv4 fragmentation always calls
inetpeer with create!=0.
Eric?
next prev parent reply other threads:[~2011-03-03 6:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 4:45 inetpeer with create==0 David Miller
2011-03-03 5:30 ` Changli Gao
2011-03-03 5:36 ` David Miller
2011-03-03 6:27 ` Changli Gao
2011-03-03 6:42 ` David Miller [this message]
2011-03-03 7:39 ` Eric Dumazet
2011-03-03 8:32 ` David Miller
2011-03-04 15:09 ` [PATCH net-next-2.6] inetpeer: seqlock optimization Eric Dumazet
2011-03-04 19:17 ` David Miller
2011-03-04 20:45 ` David Miller
2011-03-04 22:13 ` Eric Dumazet
2011-03-04 22:44 ` David Miller
2011-03-04 23:02 ` Eric Dumazet
2011-03-03 8:07 ` inetpeer with create==0 Changli Gao
2011-03-03 8:34 ` David Miller
2011-03-03 6:51 ` Eric Dumazet
2011-03-03 8:30 ` David Miller
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=20110302.224220.179921025.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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).