From owner-freebsd-net@FreeBSD.ORG Wed Sep 20 11:03:37 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 079B316A403; Wed, 20 Sep 2006 11:03:37 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from sj-iport-5.cisco.com (sj-iport-5.cisco.com [171.68.10.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id E37EF43D68; Wed, 20 Sep 2006 11:03:32 +0000 (GMT) (envelope-from rrs@cisco.com) Received: from sj-dkim-5.cisco.com ([171.68.10.79]) by sj-iport-5.cisco.com with ESMTP; 20 Sep 2006 04:03:32 -0700 X-IronPort-AV: i="4.09,190,1157353200"; d="scan'208"; a="323197724:sNHT32549588" Received: from sj-core-3.cisco.com (sj-core-3.cisco.com [171.68.223.137]) by sj-dkim-5.cisco.com (8.12.11.20060308/8.12.11) with ESMTP id k8KB3WQd031130; Wed, 20 Sep 2006 04:03:32 -0700 Received: from xbh-sjc-231.amer.cisco.com (xbh-sjc-231.cisco.com [128.107.191.100]) by sj-core-3.cisco.com (8.12.10/8.12.6) with ESMTP id k8KB3Sw7019050; Wed, 20 Sep 2006 04:03:32 -0700 (PDT) Received: from xfe-sjc-211.amer.cisco.com ([171.70.151.174]) by xbh-sjc-231.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 20 Sep 2006 04:03:27 -0700 Received: from [127.0.0.1] ([171.68.225.134]) by xfe-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 20 Sep 2006 04:03:27 -0700 Message-ID: <45112005.7030503@cisco.com> Date: Wed, 20 Sep 2006 07:03:33 -0400 From: Randall Stewart User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 FreeBSD/i386 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andre Oppermann References: <44F35A65.3080605@cisco.com> <20060828224452.GK37035@funkthat.com> <44F45A2A.8030405@freebsd.org> <20060902081043.J32527@mp2.macomnet.net> <44F9386A.30804@freebsd.org> In-Reply-To: <44F9386A.30804@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Sep 2006 11:03:27.0166 (UTC) FILETIME=[660F3DE0:01C6DCA4] DKIM-Signature: a=rsa-sha1; q=dns; l=1740; t=1158750212; x=1159614212; c=relaxed/simple; s=sjdkim5002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rrs@cisco.com; z=From:Randall=20Stewart=20 |Subject:Re=3A=20Problem=20with=20uipc_mbuf.c; X=v=3Dcisco.com=3B=20h=3DGX4otkzfuvQkPAK8JGkm7Q3VVZc=3D; b=TW14su0hkmSv1b/+S/zGXY/e/sxtA4uwQrqgZ4CMn5uwEsbSQqfKnEaGyAKwruuoYi2RBDL7 NUnvIv6Isu5uijMEuuNB0OTdfgay3UEf0A8ZerKbGF2vgZxmwXaAK5y4; Authentication-Results: sj-dkim-5.cisco.com; header.From=rrs@cisco.com; dkim=pass ( sig from cisco.com verified; ); Cc: freebsd-net@freebsd.org Subject: Re: Problem with uipc_mbuf.c X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 11:03:37 -0000 Andre Oppermann wrote: > Maxim Konovalov wrote: > >> On Tue, 29 Aug 2006, 17:15+0200, Andre Oppermann wrote: >> >>> John-Mark Gurney wrote: >>> >>>> Randall Stewart wrote this message on Mon, Aug 28, 2006 at 17:04 -0400: >>>> >>>>> atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 0) { >>>> >>>> ^ >>>> >>>> This should be 1 not 0.. as apparently fetchadd_int returns the >>>> old value (at least that's what atomic(9) says), which means that >>>> if we ever race on this comparision, we won't free though we >>>> should of... >>>> >>>> if we look at refcount.h, it does: >>>> return (atomic_fetchadd_int(count, -1) == 1); >>>> >>>> which release a reference and apparently returns true if it needs to >>>> be free'd... >>>> >>>> Though the wierd part is that andre, "fixed" it to be 0 in 1.157: >>>> Fix a logic error introduced with mandatory mbuf cluster >>>> refcounting and freeing of mbufs+clusters back to the packet zone. >>> >>> Honestly I'm a bit confused myself now and have to dig up things from >>> when I did the change. However I'm certain there was a problem and the >>> commit fixed it in some way (not necessarily the correct way). Before >>> the 'fix' there were some larger leaks going on. >> >> >> So what's the conclusion? Perhaps it's worth to add an XXX comment in >> meantime. > > > Please give me until Thursday to resolve this issue. > Andre: It is long past Thursday.... any status on this? I have not seen a commit from you on this... When I commit the SCTP code (some day soon) then we will have an mbuf leak unless we change the 0 to a 1.... R -- Randall Stewart NSSTG - Cisco Systems Inc. 803-345-0369 815-342-5222 (cell)