netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] [IPV4] route: Dynamic hash table sizing.
Date: Wed, 9 Aug 2006 10:32:54 +0200	[thread overview]
Message-ID: <200608091032.55232.dada1@cosmosbay.com> (raw)
In-Reply-To: <20060809.005337.104642177.davem@davemloft.net>

On Wednesday 09 August 2006 09:53, David Miller wrote:
> [IPV4] route: Dynamic hash table sizing.
>

 Excellent work David, Thank you !!!

> +static int ip_rt_hashsz_limit		= (8 * 1024 * 1024) / sizeof(void *);

__read_mostly ?




> +		hash = __rt_hash_code(list->fl.fl4_dst,
> +				      list->fl.fl4_src &
> +				      (iface << 5),
> +				      nhashmask);

I thought it was a XOR (^) , not a AND (&)


>  static int __init set_rhash_entries(char *str)
>  {
> +	unsigned long val;
> +
>  	if (!str)
>  		return 0;
> -	rhash_entries = simple_strtoul(str, &str, 0);
> +	val = simple_strtoul(str, &str, 0);
> +
> +	/* Only use it if it's a power-of-2. */
> +	if (!(val & (val - 1)))
> +		rhash_entries = val;
> +

Well, it breaks x86_64 machines that currently do rhash_entries=2000000
Why not round to the next/previous power of two as before ?

>  	return 1;
>  }
>  __setup("rhash_entries=", set_rhash_entries);
>

Thank you
Eric

  reply	other threads:[~2006-08-09  8:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09  7:49 [PATCHSET]: Dymamic route cache hash sizing David Miller
2006-08-09  7:53 ` [PATCH 1/2]: [IPV4] route: Locking infrastructure for dynamic routing cache sizing David Miller
2006-08-09 11:31   ` Herbert Xu
2006-08-09 23:05     ` David Miller
2006-08-09  7:53 ` [PATCH 2/2] [IPV4] route: Dynamic hash table sizing David Miller
2006-08-09  8:32   ` Eric Dumazet [this message]
2006-08-09  9:09     ` David Miller
2006-08-09 10:09   ` Eric Dumazet
2006-08-09 10:12     ` Michael Tokarev
2006-08-09 10:18       ` Evgeniy Polyakov
2006-08-09 11:14     ` David Miller
2006-08-15  8:35       ` 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=200608091032.55232.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --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 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).