提交 93ac5341 编写于 作者: D David S. Miller

ipv4: Dirty less cache lines in route caching paths.

Don't bother incrementing dst->__use and setting dst->lastuse,
they are completely pointless and just slow things down.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ba3f7f04
...@@ -1443,7 +1443,7 @@ static int __mkroute_input(struct sk_buff *skb, ...@@ -1443,7 +1443,7 @@ static int __mkroute_input(struct sk_buff *skb,
if (!(flags & RTCF_DIRECTSRC) && !itag) { if (!(flags & RTCF_DIRECTSRC) && !itag) {
rth = FIB_RES_NH(*res).nh_rth_input; rth = FIB_RES_NH(*res).nh_rth_input;
if (rt_cache_valid(rth)) { if (rt_cache_valid(rth)) {
dst_use(&rth->dst, jiffies); dst_hold(&rth->dst);
goto out; goto out;
} }
do_cache = true; do_cache = true;
...@@ -1619,7 +1619,7 @@ out: return err; ...@@ -1619,7 +1619,7 @@ out: return err;
if (!(flags & RTCF_DIRECTSRC) && !itag) { if (!(flags & RTCF_DIRECTSRC) && !itag) {
rth = FIB_RES_NH(res).nh_rth_input; rth = FIB_RES_NH(res).nh_rth_input;
if (rt_cache_valid(rth)) { if (rt_cache_valid(rth)) {
dst_use(&rth->dst, jiffies); dst_hold(&rth->dst);
goto set_and_out; goto set_and_out;
} }
do_cache = true; do_cache = true;
...@@ -1789,7 +1789,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res, ...@@ -1789,7 +1789,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
if (!fnhe) { if (!fnhe) {
rth = FIB_RES_NH(*res).nh_rth_output; rth = FIB_RES_NH(*res).nh_rth_output;
if (rt_cache_valid(rth)) { if (rt_cache_valid(rth)) {
dst_use(&rth->dst, jiffies); dst_hold(&rth->dst);
return rth; return rth;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册