netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Michael Richardson <mcr@sandelman.ottawa.on.ca>
Cc: netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com,
	netfilter-core@lists.netfilter.org
Subject: Re: TODO list before feature freeze
Date: Mon, 29 Jul 2002 22:51:47 +0200	[thread overview]
Message-ID: <20020729225147.A24288@wotan.suse.de> (raw)
In-Reply-To: <200207291525.g6TFPTTu011558@marajade.sandelman.ottawa.on.ca>

On Mon, Jul 29, 2002 at 11:25:28AM -0400, Michael Richardson wrote:
> 
> >>>>> "Andi" == Andi Kleen <ak@suse.de> writes:
>     Andi> (case in point: we have at least one report that routing
>     Andi> performance breaks down with ip_conntrack when memory size is
>     Andi> increased over 1GB on P3s. The hash table size depends on the
>     Andi> memory size. The problem does not occur on P4s. P4s have larger
>     Andi> TLBs than P3s.)
> 
>   That's a non-obvious result.
> 
>   I'll bet that most of the memory-size based hash tables in the kernel
> suffer from similar problems. A good topic for a paper, I'd say.

In fact there have been papers about this like
http://www.citi.umich.edu/projects/linux-scalability/reports/hash.html
but the results were unfortunately not adapted.

This has been discussed for a long time. Linux hash tables suffer often
from poor hash functions (some are good, but others are not so great),
excessive sizing to cover the poor functions and using double pointer heads 
when not needed (=hash table twice as big). Excessive sizing wastes memory
(several MB just for hash tables on a standard system including some gems
like a incredible big mount hash table that near nobody needs to manage 
their 5-10 mounts) 

I wrote a slist.h that works like the linux
list.h some time ago, but uses lists instead of rings with a single pointer
head to at least avoid the last problem. In the following discussion
the preference was for a more generic hash table ADT instead of another
list abstraction.

So if you wanted to put some work into this I would:

- Develop some simple and tasteful and linux like (most of the existing
ones in other software packages fail at least one of these) generic hash table
abstraction.
- Convert all the big hash tables to this generic code.
- Let it use single pointer heads.
- Make it implement the sizing based on memory size in common code with a 
single knob to tune it per system. In fact I think it should definitely
take L2 cache size in account, not only main memory.
- Add generic statistics as CONFIG option so that you can see hit rates
for all your hash tables and how much space they need.
- Make it either use the existing hash function per table or a generic good 
hash function like http://burtleburtle.net/bob/hash/evahash.html

Try out all these knobs and write a paper about it.

- Try to get it merged with the best results as default options

Unfortunately netfilter hash is a bad example for this, because its
DoS handling requirements (LRU etc.) are more complex than what most other 
linux hash tables need and I am not sure if it would make sense to 
put it into generic code. On the other hand if the generic code is flexible
enough it would be possible to implement it on top of it.

-Andi

  parent reply	other threads:[~2002-07-29 20:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-18  9:34 TODO list before feature freeze Rusty Russell
2002-07-19  7:39 ` Balazs Scheidler
2002-07-19 17:43 ` Michael Richardson
2002-07-29 10:57 ` jamal
2002-07-29 11:12   ` Andi Kleen
2002-07-29 11:23     ` jamal
2002-07-29 11:56       ` Andi Kleen
2002-07-29 15:40         ` Martin Josefsson
2002-07-29 16:15           ` Patrick Schaaf
2002-07-29 17:12             ` Martin Josefsson
2002-07-29 17:35               ` Nivedita Singhvi
2002-07-29 22:43         ` Martin Josefsson
2002-07-29 16:26       ` Patrick Schaaf
2002-07-29 16:31         ` Andi Kleen
2002-07-29 16:42           ` Patrick Schaaf
2002-07-29 16:45             ` Patrick Schaaf
2002-07-30 11:58         ` jamal
2002-07-30 12:27           ` Patrick Schaaf
2002-07-30 12:29             ` jamal
2002-07-30 13:06               ` Patrick Schaaf
2002-07-30 13:42                 ` jamal
2002-07-30 13:08               ` Martin Josefsson
2002-07-30 15:54                 ` Filip Sneppe (Cronos)
2002-07-29 15:25     ` Michael Richardson
2002-07-29 15:52       ` Patrick Schaaf
2002-07-29 20:51       ` Andi Kleen [this message]
2002-07-30  7:26         ` Patrick Schaaf
2002-07-29 22:14   ` Rusty Russell
2002-07-30 12:04     ` jamal

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=20020729225147.A24288@wotan.suse.de \
    --to=ak@suse.de \
    --cc=mcr@sandelman.ottawa.on.ca \
    --cc=netdev@oss.sgi.com \
    --cc=netfilter-core@lists.netfilter.org \
    --cc=netfilter-devel@lists.netfilter.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).