From 6498535608260fbd1777a21e6acac17b05abfbec Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 26 Jun 2012 00:10:09 -0700 Subject: [PATCH] --- yaml --- r: 314623 b: refs/heads/master c: df67e6c9a6ca59ca96bdd46a500ae9dd596f427c h: refs/heads/master i: 314621: 62631d0bc74c379a7dda50b8ef4043f1bacf9501 314619: c13357917efe0a1263767bfd7c2eaf179fea24af 314615: 65be1311c2a54dcef46d7b9b57abc7ce0461ebba 314607: d2a22ab0af48d0e9e0e98e94ba5606c004c19e3d 314591: 2c54d0b54d38fe8646efd9f7558027cd98d76175 314559: 61a757401c2a91c6b4792cc0e9e05cf8c5ddbff4 314495: f33d7aeecf75aae74f3c6e090d0d4b9bfabf4bac 314367: 6de25810a3e400c22694f8f42a9e4472cca98f4b v: v3 --- [refs] | 2 +- trunk/net/ipv4/route.c | 34 +++++++++++----------------------- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/[refs] b/[refs] index 3013d4ae62e2..693939c4c5c1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 29cb99de4dafc53f75389bbe0173af4385a2ed1d +refs/heads/master: df67e6c9a6ca59ca96bdd46a500ae9dd596f427c diff --git a/trunk/net/ipv4/route.c b/trunk/net/ipv4/route.c index 8d62d85e68dc..846961c6cbe1 100644 --- a/trunk/net/ipv4/route.c +++ b/trunk/net/ipv4/route.c @@ -870,34 +870,22 @@ static void rt_check_expire(void) while ((rth = rcu_dereference_protected(*rthp, lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) { prefetch(rth->dst.rt_next); - if (rt_is_expired(rth)) { + if (rt_is_expired(rth) || + rt_may_expire(rth, tmo, ip_rt_gc_timeout)) { *rthp = rth->dst.rt_next; rt_free(rth); continue; } - if (rth->dst.expires) { - /* Entry is expired even if it is in use */ - if (time_before_eq(jiffies, rth->dst.expires)) { -nofree: - tmo >>= 1; - rthp = &rth->dst.rt_next; - /* - * We only count entries on - * a chain with equal hash inputs once - * so that entries for different QOS - * levels, and other non-hash input - * attributes don't unfairly skew - * the length computation - */ - length += has_noalias(rt_hash_table[i].chain, rth); - continue; - } - } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) - goto nofree; - /* Cleanup aged off entries. */ - *rthp = rth->dst.rt_next; - rt_free(rth); + /* We only count entries on a chain with equal + * hash inputs once so that entries for + * different QOS levels, and other non-hash + * input attributes don't unfairly skew the + * length computation + */ + tmo >>= 1; + rthp = &rth->dst.rt_next; + length += has_noalias(rt_hash_table[i].chain, rth); } spin_unlock_bh(rt_hash_lock_addr(i)); sum += length;