devres: implement pcim_iomap_regions()
[powerpc.git] / net / core / dst.c
index 470c05b..1a53fb3 100644 (file)
@@ -95,12 +95,18 @@ static void dst_run_gc(unsigned long dummy)
                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",
               atomic_read(&dst_total), delayed,  dst_gc_timer_expires);
 #endif
-       add_timer(&dst_gc_timer);
+       /* 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);
@@ -126,7 +132,7 @@ void * dst_alloc(struct dst_ops * ops)
                if (ops->gc())
                        return NULL;
        }
-       dst = kmem_cache_alloc(ops->kmem_cachep, SLAB_ATOMIC);
+       dst = kmem_cache_alloc(ops->kmem_cachep, GFP_ATOMIC);
        if (!dst)
                return NULL;
        memset(dst, 0, ops->entry_size);