Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314623
b: refs/heads/master
c: df67e6c
h: refs/heads/master
i:
  314621: 62631d0
  314619: c133579
  314615: 65be131
  314607: d2a22ab
  314591: 2c54d0b
  314559: 61a7574
  314495: f33d7ae
  314367: 6de2581
v: v3
  • Loading branch information
David S. Miller committed Jun 26, 2012
1 parent 2f4dbd2 commit 6498535
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29cb99de4dafc53f75389bbe0173af4385a2ed1d
refs/heads/master: df67e6c9a6ca59ca96bdd46a500ae9dd596f427c
34 changes: 11 additions & 23 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6498535

Please sign in to comment.