Just making sure netdev folks saw this.

I'll probably push this into 2.6.13 some time tomorrow.
--- Begin Message ---
The patch titled

     negative timer loop with lots of IPv4 peers

has been added to the -mm tree.  Its filename is

     negative-timer-loop-with-lots-of-ipv4-peers.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

negative-timer-loop-with-lots-of-ipv4-peers.patch



From: Dave Johnson <[EMAIL PROTECTED]>

Found this bug while doing some scaling testing that created 500K inet
peers.

peer_check_expire() in net/ipv4/inetpeer.c isn't using inet_peer_gc_mintime
correctly and will end up creating an expire timer with less than the
minimum duration, and even zero/negative if enough active peers are
present.

If >65K peers, the timer will be less than inet_peer_gc_mintime, and with
>70K peers, the timer duration will reach zero and go negative.

The timer handler will continue to schedule another zero/negative timer in
a loop until peers can be aged.  This can continue for at least a few
minutes or even longer if the peers remain active due to arriving packets
while the loop is occurring.

Bug is present in both 2.4 and 2.6.  Same patch will apply to both just
fine.

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/ipv4/inetpeer.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff -puN net/ipv4/inetpeer.c~negative-timer-loop-with-lots-of-ipv4-peers 
net/ipv4/inetpeer.c
--- devel/net/ipv4/inetpeer.c~negative-timer-loop-with-lots-of-ipv4-peers       
2005-08-21 21:56:05.000000000 -0700
+++ devel-akpm/net/ipv4/inetpeer.c      2005-08-21 21:56:05.000000000 -0700
@@ -451,9 +451,12 @@ static void peer_check_expire(unsigned l
        /* Trigger the timer after inet_peer_gc_mintime .. inet_peer_gc_maxtime
         * interval depending on the total number of entries (more entries,
         * less interval). */
-       peer_periodic_timer.expires = jiffies
-               + inet_peer_gc_maxtime
-               - (inet_peer_gc_maxtime - inet_peer_gc_mintime) / HZ *
-                       peer_total / inet_peer_threshold * HZ;
+       if (peer_total >= inet_peer_threshold)
+               peer_periodic_timer.expires = jiffies + inet_peer_gc_mintime;
+       else
+               peer_periodic_timer.expires = jiffies
+                       + inet_peer_gc_maxtime
+                       - (inet_peer_gc_maxtime - inet_peer_gc_mintime) / HZ *
+                               peer_total / inet_peer_threshold * HZ;
        add_timer(&peer_periodic_timer);
 }
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- End Message ---

Reply via email to