diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-05 20:59:51 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-08 15:38:52 -0500 |
commit | f5a6e01c093ca60c0cab15c47c8e7e199fbbc9e6 (patch) | |
tree | 6d7a09c26917bebf6faeb13f90eaec230c4311e0 /net/core/dst.c | |
parent | 104439a8876a98eac1b6593907a3c7bc51e362fe (diff) |
[NET]: user of the jiffies rounding code: Networking
This patch introduces users of the round_jiffies() function in the
networking code.
These timers all were of the "about once a second" or "about once
every X seconds" variety and several showed up in the "what wakes the
cpu up" profiles that the tickless patches provide. Some timers are
highly dynamic based on network load; but even on low activity systems
they still show up so the rounding is done only in cases of low
activity, allowing higher frequency timers in the high activity case.
The various hardware watchdogs are an obvious case; they run every 2
seconds but aren't otherwise specific of exactly when they need to
run.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dst.c')
-rw-r--r-- | net/core/dst.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 836ec6606925..1a53fb39b7e0 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -99,7 +99,14 @@ static void dst_run_gc(unsigned long dummy) | |||
99 | printk("dst_total: %d/%d %ld\n", | 99 | printk("dst_total: %d/%d %ld\n", |
100 | atomic_read(&dst_total), delayed, dst_gc_timer_expires); | 100 | atomic_read(&dst_total), delayed, dst_gc_timer_expires); |
101 | #endif | 101 | #endif |
102 | mod_timer(&dst_gc_timer, jiffies + dst_gc_timer_expires); | 102 | /* if the next desired timer is more than 4 seconds in the future |
103 | * then round the timer to whole seconds | ||
104 | */ | ||
105 | if (dst_gc_timer_expires > 4*HZ) | ||
106 | mod_timer(&dst_gc_timer, | ||
107 | round_jiffies(jiffies + dst_gc_timer_expires)); | ||
108 | else | ||
109 | mod_timer(&dst_gc_timer, jiffies + dst_gc_timer_expires); | ||
103 | 110 | ||
104 | out: | 111 | out: |
105 | spin_unlock(&dst_lock); | 112 | spin_unlock(&dst_lock); |