From: Dave Johnson <djohnson+linux-kernel@sw.starentnetworks.com>
To: linux-kernel@vger.kernel.org, linux-net@vger.kernel.org,
davem@davemloft.net
Subject: [PATCH] negative timer loop with lots of IPv4 peers
Date: Fri, 19 Aug 2005 13:21:32 -0400 [thread overview]
Message-ID: <17158.5404.508348.433079@cortez.sw.starentnetworks.com> (raw)
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.
--
Dave Johnson
Starent Networks
===== net/ipv4/inetpeer.c 1.12 vs edited =====
--- 1.12/net/ipv4/inetpeer.c 2005-06-24 16:16:59 -04:00
+++ edited/net/ipv4/inetpeer.c 2005-08-19 10:34:00 -04:00
@@ -490,10 +490,13 @@
/* 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);
}
reply other threads:[~2005-08-19 17:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17158.5404.508348.433079@cortez.sw.starentnetworks.com \
--to=djohnson+linux-kernel@sw.starentnetworks.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®