mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 09:50:04 +00:00
ipv4: Remove unnecessary code from rt_check_expire().
IPv4 routing cache entries no longer use dst->expires, because the metrics, PMTU, and redirect information are stored in the inetpeer cache. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
29cb99de4d
commit
df67e6c9a6
1 changed files with 11 additions and 23 deletions
|
@ -870,34 +870,22 @@ static void rt_check_expire(void)
|
||||||
while ((rth = rcu_dereference_protected(*rthp,
|
while ((rth = rcu_dereference_protected(*rthp,
|
||||||
lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) {
|
lockdep_is_held(rt_hash_lock_addr(i)))) != NULL) {
|
||||||
prefetch(rth->dst.rt_next);
|
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;
|
*rthp = rth->dst.rt_next;
|
||||||
rt_free(rth);
|
rt_free(rth);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (rth->dst.expires) {
|
|
||||||
/* Entry is expired even if it is in use */
|
/* We only count entries on a chain with equal
|
||||||
if (time_before_eq(jiffies, rth->dst.expires)) {
|
* hash inputs once so that entries for
|
||||||
nofree:
|
* different QOS levels, and other non-hash
|
||||||
|
* input attributes don't unfairly skew the
|
||||||
|
* length computation
|
||||||
|
*/
|
||||||
tmo >>= 1;
|
tmo >>= 1;
|
||||||
rthp = &rth->dst.rt_next;
|
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);
|
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);
|
|
||||||
}
|
}
|
||||||
spin_unlock_bh(rt_hash_lock_addr(i));
|
spin_unlock_bh(rt_hash_lock_addr(i));
|
||||||
sum += length;
|
sum += length;
|
||||||
|
|
Loading…
Reference in a new issue