netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dada1@cosmosbay.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] [IPV4] route: Dynamic hash table sizing.
Date: Wed, 09 Aug 2006 04:14:52 -0700 (PDT)	[thread overview]
Message-ID: <20060809.041452.102575985.davem@davemloft.net> (raw)
In-Reply-To: <200608091209.29231.dada1@cosmosbay.com>

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Wed, 9 Aug 2006 12:09:28 +0200

> On Wednesday 09 August 2006 09:53, David Miller wrote:
> 
> > +	if (atomic_read(&ipv4_dst_ops.entries) >= (hmask + 1) &&
> > +	    (hmask + 1) < ip_rt_hashsz_limit)
> > +		schedule_work(&rtcache_work);
> > +	return 0;
> >  }
> >
> 
> I wonder if you should not replicate this test (against (hmask + 1) < 
> ip_rt_hashsz_limit) in rtcache_resize() itself, because we might end calling 
> rthash_new_size() while (hmask +1 ) = ip_rt_hashsz_limit

That's a good point, let me think about that.

> > -       mult = ((u64)ip_rt_gc_interval) << long_log2(hmask + 1);
> > +       mult = ((u64)(hmask + 1)) << (u64)ip_rt_gc_interval;
> 
> Not sure I understand what you did here (in rt_check_expire()), could you 
> please explain the math ? (I may be wrong but (x * 2^y) != (y * 2^x) for 
> general values of x and y)

Indeed I'm a retard.

I made the same error in another location:

@@ -857,7 +984,7 @@ static int rt_garbage_collect(void)
 
 	/* Calculate number of entries, which we want to expire now. */
 	goal = atomic_read(&ipv4_dst_ops.entries) -
-		(ip_rt_gc_elasticity << long_log2(hmask + 1));
+		((hmask + 1) << ip_rt_gc_elasticity);

I'll revert both of those changes, thanks.

  parent reply	other threads:[~2006-08-09 11:14 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
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 [this message]
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=20060809.041452.102575985.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dada1@cosmosbay.com \
    --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).