diff --git a/net/core/dst.c b/net/core/dst.c index 836ec66069254752c7ca2b9db0a597419dd758a2..1a53fb39b7e008efa67709bcd4ac984426e064df 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -99,7 +99,14 @@ static void dst_run_gc(unsigned long dummy) printk("dst_total: %d/%d %ld\n", atomic_read(&dst_total), delayed, dst_gc_timer_expires); #endif - mod_timer(&dst_gc_timer, jiffies + dst_gc_timer_expires); + /* if the next desired timer is more than 4 seconds in the future + * then round the timer to whole seconds + */ + if (dst_gc_timer_expires > 4*HZ) + mod_timer(&dst_gc_timer, + round_jiffies(jiffies + dst_gc_timer_expires)); + else + mod_timer(&dst_gc_timer, jiffies + dst_gc_timer_expires); out: spin_unlock(&dst_lock); diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 9e26f38ea6e58fd26e2af3e78be1914050e26341..054d46493d2be47b4ab9b4a467dd8f08052b5bf3 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -696,7 +696,10 @@ static void neigh_periodic_timer(unsigned long arg) if (!expire) expire = 1; - mod_timer(&tbl->gc_timer, now + expire); + if (expire>HZ) + mod_timer(&tbl->gc_timer, round_jiffies(now + expire)); + else + mod_timer(&tbl->gc_timer, now + expire); write_unlock(&tbl->lock); } diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index bc116bd6937c01ffba6adcb142161f38b05b7e8c..3b6e6a7809278f69769ca764f65df928d0e023d3 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -209,7 +209,7 @@ static void dev_watchdog(unsigned long arg) dev->name); dev->tx_timeout(dev); } - if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) + if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + dev->watchdog_timeo))) dev_hold(dev); } }