ipv4: Dirty less cache lines in route caching paths.
authorDavid S. Miller <davem@davemloft.net>
Tue, 17 Jul 2012 21:09:39 +0000 (14:09 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Jul 2012 20:36:55 +0000 (13:36 -0700)
Don't bother incrementing dst->__use and setting dst->lastuse,
they are completely pointless and just slow things down.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c

index 7e1c0ed0ef701dbcd2feba7573efacf336426672..b8707779b85d0a4c610e98b35189fda8e56a37c0 100644 (file)
@@ -1443,7 +1443,7 @@ static int __mkroute_input(struct sk_buff *skb,
                if (!(flags & RTCF_DIRECTSRC) && !itag) {
                        rth = FIB_RES_NH(*res).nh_rth_input;
                        if (rt_cache_valid(rth)) {
-                               dst_use(&rth->dst, jiffies);
+                               dst_hold(&rth->dst);
                                goto out;
                        }
                        do_cache = true;
@@ -1619,7 +1619,7 @@ local_input:
                if (!(flags & RTCF_DIRECTSRC) && !itag) {
                        rth = FIB_RES_NH(res).nh_rth_input;
                        if (rt_cache_valid(rth)) {
-                               dst_use(&rth->dst, jiffies);
+                               dst_hold(&rth->dst);
                                goto set_and_out;
                        }
                        do_cache = true;
@@ -1789,7 +1789,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
                if (!fnhe) {
                        rth = FIB_RES_NH(*res).nh_rth_output;
                        if (rt_cache_valid(rth)) {
-                               dst_use(&rth->dst, jiffies);
+                               dst_hold(&rth->dst);
                                return rth;
                        }
                }