From owner-svn-src-all@FreeBSD.ORG Thu Apr 7 19:53:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14BC0106566C; Thu, 7 Apr 2011 19:53:00 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id D79398FC08; Thu, 7 Apr 2011 19:52:59 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p37JqtJ1069901 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 7 Apr 2011 12:52:58 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4D9E1637.1000200@freebsd.org> Date: Thu, 07 Apr 2011 12:53:27 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Marko Zec References: <201104071140.p37BeAlE039248@svn.freebsd.org> <20110407135440.GX84445@FreeBSD.org> <201104071615.49994.zec@freebsd.org> In-Reply-To: <201104071615.49994.zec@freebsd.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org Subject: Re: svn commit: r220416 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2011 19:53:00 -0000 On 4/7/11 7:15 AM, Marko Zec wrote: > On Thursday 07 April 2011 15:54:40 Gleb Smirnoff wrote: >> On Thu, Apr 07, 2011 at 11:40:10AM +0000, Marko Zec wrote: >> M> Author: zec >> M> Date: Thu Apr 7 11:40:10 2011 >> M> New Revision: 220416 >> M> URL: http://svn.freebsd.org/changeset/base/220416 >> M> >> M> Log: >> M> Properly unref ng_hub nodes on shutdown, so that we don't leak them. >> M> >> M> MFC after: 3 days >> M> >> M> Modified: >> M> head/sys/netgraph/ng_hub.c >> M> >> M> Modified: head/sys/netgraph/ng_hub.c >> M> >> =========================================================================== >> === M> --- head/sys/netgraph/ng_hub.c Thu Apr 7 11:13:50 2011 (r220415) M> >> +++ head/sys/netgraph/ng_hub.c Thu Apr 7 11:40:10 2011 (r220416) M> @@ >> -157,6 +157,8 @@ ng_hub_shutdown(node_p node) >> M> const priv_p priv = NG_NODE_PRIVATE(node); >> M> >> M> free(priv, M_NETGRAPH_HUB); >> M> + NG_NODE_SET_PRIVATE(node, NULL); >> M> + NG_NODE_UNREF(node); >> M> return (0); >> M> } >> >> Do we really need NG_NODE_SET_PRIVATE()? > Most probably not, though the majority of .shutdown method implementations in > sys/netgraph do include a call to NG_NODE_SET_PRIVATE(node, NULL), so I did a > C/P from one of those for consistency. If there's a consensus that > NG_NODE_SET_PRIVATE(node, NULL) in shutdown methods serves no useful purpose > then we should do a sweep across all the existing nodes... I'd rather do it than not do it. private data can refer to stuff that has been malloc'd and at one stage I had debug code that checked for NULL there to catch leaks there's no speed advantage to shutting down faster.. :-) > Marko >