From owner-freebsd-hackers Sun Feb 3 20:13:48 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from patrocles.silby.com (d127.as1.nwbl0.wi.voyager.net [169.207.130.193]) by hub.freebsd.org (Postfix) with ESMTP id 9465037B416 for ; Sun, 3 Feb 2002 20:13:42 -0800 (PST) Received: from localhost (silby@localhost) by patrocles.silby.com (8.11.6/8.11.6) with ESMTP id g13MH0813560; Sun, 3 Feb 2002 22:17:01 GMT (envelope-from silby@silby.com) X-Authentication-Warning: patrocles.silby.com: silby owned process doing -bs Date: Sun, 3 Feb 2002 22:17:00 +0000 (GMT) From: Mike Silbersack To: Terry Lambert Cc: Alfred Perlstein , Luigi Rizzo , Storms of Perfection , , , Subject: Re: Clock Granularity (kernel option HZ) In-Reply-To: <3C5A8290.216BB28C@mindspring.com> Message-ID: <20020203220958.Q13287-100000@patrocles.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 1 Feb 2002, Terry Lambert wrote: > I guess you are talking the LRP stuff. > > I was just talking about the processing at NETISR as a > result of a higher HZ causing a higher softintr run > frequency. Interesting; I hadn't considered that scheduling could have an effect on performance, but that does make sense on a heavily loaded system. > Really, the timer code that TCP uses is all bogus for a > large number of connections, and upping the clock wheel > size doesn't gain you nearly as much as interval specific > lists which only have to process until the intended time > to fire is later than "now". The clock stuff as it is > has to traverse the entire chain, because it can't know > that the firing of the timer after the current one is later > than the current one (i.e. intervals of 1 second and one > hour can end up in the same wheel bucket, because it is, in > effect, an unsorted modular timer, and inserting sorted for > more than one or two intervals is an O(N) problem). > > -- Terry I was looking at the timer implementation a few weeks ago and pondering if it could be improved as well. I think it's quite clever if you're dealing with a quantity of timers < 1000 or so, but it looks like it could be more optimal when used with the quantity of timers we have these days. Did you attempt to combine the various tcp timers so that there would be one callout per socket? I think it would be a pretty easy task; just store the various timers inside each socket, and only set a callout for the soonest to wake one. Upon wakeup, quickly check them all. That would reduce the total number of events in the callout wheel for one, and might help with the hash function aliasing long-term events such as keepalives into the current time. (I'm assuming that the retransmission and other short-term timers do a good job of keeping themselves just ahead of the clockhand that they aren't falsely checked.) Mike "Silby" Silbersack To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message