From 3a9b14a7de0e50c430cac6ba15f6ecce80b4e321 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 5 Feb 2007 17:59:51 -0800 Subject: [PATCH] --- yaml --- r: 46942 b: refs/heads/master c: f5a6e01c093ca60c0cab15c47c8e7e199fbbc9e6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/core/dst.c | 9 ++++++++- trunk/net/core/neighbour.c | 5 ++++- trunk/net/sched/sch_generic.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 820338c369aa..65f15bdfbbcf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 104439a8876a98eac1b6593907a3c7bc51e362fe +refs/heads/master: f5a6e01c093ca60c0cab15c47c8e7e199fbbc9e6 diff --git a/trunk/net/core/dst.c b/trunk/net/core/dst.c index 836ec6606925..1a53fb39b7e0 100644 --- a/trunk/net/core/dst.c +++ b/trunk/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/trunk/net/core/neighbour.c b/trunk/net/core/neighbour.c index 9e26f38ea6e5..054d46493d2b 100644 --- a/trunk/net/core/neighbour.c +++ b/trunk/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/trunk/net/sched/sch_generic.c b/trunk/net/sched/sch_generic.c index bc116bd6937c..3b6e6a780927 100644 --- a/trunk/net/sched/sch_generic.c +++ b/trunk/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); } }