From owner-freebsd-current Mon Nov 29 10: 7: 2 1999 Delivered-To: freebsd-current@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id C560B15282 for ; Mon, 29 Nov 1999 10:06:57 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id NAA35374; Mon, 29 Nov 1999 13:06:34 -0500 (EST) (envelope-from wollman) Date: Mon, 29 Nov 1999 13:06:34 -0500 (EST) From: Garrett Wollman Message-Id: <199911291806.NAA35374@khavrinen.lcs.mit.edu> To: John Polstra Cc: wollman@khavrinen.lcs.mit.edu, current@freebsd.org Subject: Re: Route table leaks In-Reply-To: <199911270141.RAA29416@vashon.polstra.com> References: <199911220150.UAA78559@khavrinen.lcs.mit.edu> <199911221552.KAA84691@khavrinen.lcs.mit.edu> <199911270141.RAA29416@vashon.polstra.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: > The route disappears from the routing table, but it is > not freed. (The Leak.) Actually, no. > Now cause some packets to travel on the connection. A new cloned > route is created and added to the routing table. Here is where the leak happens, as demonstrated by your patch. (Great detective work, BTW.) > 1. Do I really need the splnet calls around RTFREE? I don't think so. All calls into the routing code should already be protected by splnet. We may have to revisit this in the future for finer-grained locking. > 2. To eliminate all the duplicated code, shall I make rtalloc just > call rtalloc_ign(ro, 0UL)? I assume that was avoided originally for > performance reasons, but now there's more code than before. Actually, it was avoided originally because it was easier to just cut and paste. There is no inherent reason for the duplication, although Matt's suggestion of topologically sorting the routines so that GCC will have a chance at inlining is not a bad one. (I'd actually like to find all the calls to rtalloc() and simply add an extra argument to them. I can't fathom why I didn't do that five years ago....) -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message