From: Eric Dumazet <[EMAIL PROTECTED]>
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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to