ipv6: prevent fib6_run_gc() contention
[deliverable/linux.git] / net / ipv6 / route.c
index a8c891aa24645e9a45d2f8e47712b0698a29b216..824c424f96485a2a8fca78f3b0110c501cd17d44 100644 (file)
@@ -1326,7 +1326,7 @@ static int ip6_dst_gc(struct dst_ops *ops)
                goto out;
 
        net->ipv6.ip6_rt_gc_expire++;
-       fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net);
+       fib6_run_gc(net->ipv6.ip6_rt_gc_expire, net, entries > rt_max_size);
        net->ipv6.ip6_rt_last_gc = now;
        entries = dst_entries_get_slow(ops);
        if (entries < ops->gc_thresh)
@@ -2827,7 +2827,7 @@ int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write,
        net = (struct net *)ctl->extra1;
        delay = net->ipv6.sysctl.flush_delay;
        proc_dointvec(ctl, write, buffer, lenp, ppos);
-       fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);
+       fib6_run_gc(delay <= 0 ? 0 : (unsigned long)delay, net, delay > 0);
        return 0;
 }
 
This page took 0.029437 seconds and 5 git commands to generate.