From 3ca5fda8a68f4d99798a33a0aefbbc1ba8611615 Mon Sep 17 00:00:00 2001 From: Denis Lunev Date: Sat, 30 Jul 2005 17:47:25 -0700 Subject: [PATCH] --- yaml --- r: 5529 b: refs/heads/master c: f0098f7863f814a5adc0b9cb271605d063cad7fa h: refs/heads/master i: 5527: aa2acc61e4126a31b725b3efdaaa0646350d183d v: v3 --- [refs] | 2 +- trunk/net/core/dst.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 6fe12971c590..a9e1db7f4f38 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: db44575f6fd55df6ff67ddd21f7ad5be5a741136 +refs/heads/master: f0098f7863f814a5adc0b9cb271605d063cad7fa diff --git a/trunk/net/core/dst.c b/trunk/net/core/dst.c index fc434ade5270..334790da9f16 100644 --- a/trunk/net/core/dst.c +++ b/trunk/net/core/dst.c @@ -45,6 +45,7 @@ static struct timer_list dst_gc_timer = static void dst_run_gc(unsigned long dummy) { int delayed = 0; + int work_performed; struct dst_entry * dst, **dstp; if (!spin_trylock(&dst_lock)) { @@ -52,9 +53,9 @@ static void dst_run_gc(unsigned long dummy) return; } - del_timer(&dst_gc_timer); dstp = &dst_garbage_list; + work_performed = 0; while ((dst = *dstp) != NULL) { if (atomic_read(&dst->__refcnt)) { dstp = &dst->next; @@ -62,6 +63,7 @@ static void dst_run_gc(unsigned long dummy) continue; } *dstp = dst->next; + work_performed = 1; dst = dst_destroy(dst); if (dst) { @@ -86,9 +88,14 @@ static void dst_run_gc(unsigned long dummy) dst_gc_timer_inc = DST_GC_MAX; goto out; } - if ((dst_gc_timer_expires += dst_gc_timer_inc) > DST_GC_MAX) - dst_gc_timer_expires = DST_GC_MAX; - dst_gc_timer_inc += DST_GC_INC; + if (!work_performed) { + if ((dst_gc_timer_expires += dst_gc_timer_inc) > DST_GC_MAX) + dst_gc_timer_expires = DST_GC_MAX; + dst_gc_timer_inc += DST_GC_INC; + } else { + dst_gc_timer_inc = DST_GC_INC; + dst_gc_timer_expires = DST_GC_MIN; + } dst_gc_timer.expires = jiffies + dst_gc_timer_expires; #if RT_CACHE_DEBUG >= 2 printk("dst_total: %d/%d %ld\n",