Hi,

On Thu, Nov 01, 2007 at 07:39:08PM +0100, Andreas Mohr wrote:
> Hi,
> 
> On Mon, Jul 16, 2007 at 04:52:53PM +0400, Alexey Kuznetsov wrote:
> > Not needed. I will try to repair this and send the patch for testing.
> 
> I just tried powertop on stock 2.6.23 on this box now and noticed that
> neigh_periodic_timer has these 17.7 wakeups/sec there, too.
> 
> Do you happen to have a hint for this? Maybe I should investigate this
> issue.

OK, I've had a more intense look at it now, and it appears there's a
grave bug in there (or I don't understand it correctly, which could
easily be the case OTOH):

# ls /proc/sys/net/ipv4/neigh/default/base_reachable_time*
/proc/sys/net/ipv4/neigh/default/base_reachable_time
/proc/sys/net/ipv4/neigh/default/base_reachable_time_ms

# cat /proc/sys/net/ipv4/neigh/default/base_reachable_time*
30
30000

IOW, the reachable time is 30 seconds.

And HZ on my system is configured to 300, IOW 300 ticks/second.

Then why the heck do we do:

        /* Cycle through all hash buckets every base_reachable_time/2 ticks.
         * ARP entry timeouts range from 1/2 base_reachable_time to 3/2
         * base_reachable_time.
         */
        expire = tbl->parms.base_reachable_time >> 1;
        expire /= (tbl->hash_mask + 1);
        if (!expire)
                expire = 1;

        if (expire>HZ)
                mod_timer(&tbl->gc_timer, round_jiffies(now + expire));
        else
                mod_timer(&tbl->gc_timer, now + expire);

        write_unlock(&tbl->lock);


I'd guess the cycling is meant to happen every *half period* of the
reachable time (i.e. every 15 **seconds**).
Instead, we do it every base_reachable_time/2 **ticks**,
i.e. every 15 ticks, which is (at 300 ticks/second) roughly 20 times per
second (plus-minus some timer period scheduling leeway, which lets it get to
17.7/second as in my case), which sounds way too high.

I guess that my reasoning is correct, since I really wouldn't understand
why the amount of timer invocations here is implemented to be
*directly proportional* to the HZ number configured. That doesn't
make sense to me.
At HZ=1000, this timer would be invoked around 60 times per second, then??

Thanks,

Andreas Mohr

_______________________________________________
Power mailing list
[email protected]
http://www.bughost.org/mailman/listinfo/power

Reply via email to