diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dst.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index fc434ade5270..334790da9f16 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -45,6 +45,7 @@ static struct timer_list dst_gc_timer = | |||
45 | static void dst_run_gc(unsigned long dummy) | 45 | static void dst_run_gc(unsigned long dummy) |
46 | { | 46 | { |
47 | int delayed = 0; | 47 | int delayed = 0; |
48 | int work_performed; | ||
48 | struct dst_entry * dst, **dstp; | 49 | struct dst_entry * dst, **dstp; |
49 | 50 | ||
50 | if (!spin_trylock(&dst_lock)) { | 51 | if (!spin_trylock(&dst_lock)) { |
@@ -52,9 +53,9 @@ static void dst_run_gc(unsigned long dummy) | |||
52 | return; | 53 | return; |
53 | } | 54 | } |
54 | 55 | ||
55 | |||
56 | del_timer(&dst_gc_timer); | 56 | del_timer(&dst_gc_timer); |
57 | dstp = &dst_garbage_list; | 57 | dstp = &dst_garbage_list; |
58 | work_performed = 0; | ||
58 | while ((dst = *dstp) != NULL) { | 59 | while ((dst = *dstp) != NULL) { |
59 | if (atomic_read(&dst->__refcnt)) { | 60 | if (atomic_read(&dst->__refcnt)) { |
60 | dstp = &dst->next; | 61 | dstp = &dst->next; |
@@ -62,6 +63,7 @@ static void dst_run_gc(unsigned long dummy) | |||
62 | continue; | 63 | continue; |
63 | } | 64 | } |
64 | *dstp = dst->next; | 65 | *dstp = dst->next; |
66 | work_performed = 1; | ||
65 | 67 | ||
66 | dst = dst_destroy(dst); | 68 | dst = dst_destroy(dst); |
67 | if (dst) { | 69 | if (dst) { |
@@ -86,9 +88,14 @@ static void dst_run_gc(unsigned long dummy) | |||
86 | dst_gc_timer_inc = DST_GC_MAX; | 88 | dst_gc_timer_inc = DST_GC_MAX; |
87 | goto out; | 89 | goto out; |
88 | } | 90 | } |
89 | if ((dst_gc_timer_expires += dst_gc_timer_inc) > DST_GC_MAX) | 91 | if (!work_performed) { |
90 | dst_gc_timer_expires = DST_GC_MAX; | 92 | if ((dst_gc_timer_expires += dst_gc_timer_inc) > DST_GC_MAX) |
91 | dst_gc_timer_inc += DST_GC_INC; | 93 | dst_gc_timer_expires = DST_GC_MAX; |
94 | dst_gc_timer_inc += DST_GC_INC; | ||
95 | } else { | ||
96 | dst_gc_timer_inc = DST_GC_INC; | ||
97 | dst_gc_timer_expires = DST_GC_MIN; | ||
98 | } | ||
92 | dst_gc_timer.expires = jiffies + dst_gc_timer_expires; | 99 | dst_gc_timer.expires = jiffies + dst_gc_timer_expires; |
93 | #if RT_CACHE_DEBUG >= 2 | 100 | #if RT_CACHE_DEBUG >= 2 |
94 | printk("dst_total: %d/%d %ld\n", | 101 | printk("dst_total: %d/%d %ld\n", |