netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Jarek Poplawski <jarkao2@o2.pl>
Cc: Simon Lodal <simonl@parknet.dk>,
	Patrick McHardy <kaber@trash.net>,
	netdev@vger.kernel.org, lartc@mailman.ds9a.nl
Subject: Re: [PATCH] HTB O(1) class lookup
Date: Mon, 5 Feb 2007 12:24:53 +0100	[thread overview]
Message-ID: <200702051224.53777.ak@suse.de> (raw)
In-Reply-To: <20070205101637.GB1863@ff.dom.local>

On Monday 05 February 2007 11:16, Jarek Poplawski wrote:

> 
> Strange - it seems you gave only arguments against this
> analysis...

For a naturally clustered key space (as is common in this case) the two 
level structure is likely more cache efficient than a generic hash function. 
That is because the hash will likely spread out the natural clusters and then require
more cache lines to access them because there will be less sharing.

Ok in theory a very tuned for this case hash function might have similar 
properties, but normally people don't put that much care into 
designing hashes and just use some generic one.

> > And the worst memory consumption case considered by Patrick should
> > be relatively unlikely.
> 
> Anyway, such approach, that most users do something
> this (reasonable) way, doesn't look like good
> programming practice.

In the unlikely worst case they will get half a MB of tables. Hardly a 
show stopper. 

> I wonder, why not try, at least for a while, to do this
> a compile (menuconfig) option with a comment:
> recommended for a large number of classes. After hash
> optimization and some testing, final decisions could be
> made.

There are already far too many obscure CONFIGs. Don't add more.

-Andi
 

  reply	other threads:[~2007-02-05 11:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-01  5:18 [PATCH] HTB O(1) class lookup Simon Lodal
2007-02-01  6:08 ` Patrick McHardy
2007-02-01  7:08   ` Simon Lodal
2007-02-01 11:30     ` Andi Kleen
2007-02-05 10:16       ` Jarek Poplawski
2007-02-05 11:24         ` Andi Kleen [this message]
2007-02-05 12:45           ` Ingo Oeser
2007-02-05 17:14         ` Simon Lodal
2007-02-06  8:08           ` Jarek Poplawski
2007-02-08  7:36           ` Jarek Poplawski
2007-02-05 18:21       ` Simon Lodal
2007-02-01 13:06   ` 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=200702051224.53777.ak@suse.de \
    --to=ak@suse.de \
    --cc=jarkao2@o2.pl \
    --cc=kaber@trash.net \
    --cc=lartc@mailman.ds9a.nl \
    --cc=netdev@vger.kernel.org \
    --cc=simonl@parknet.dk \
    /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).