From owner-freebsd-net Thu Jul 11 22:30:13 2002 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 6A4C537B400 for ; Thu, 11 Jul 2002 22:30:04 -0700 (PDT) Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6203C43E52 for ; Thu, 11 Jul 2002 22:30:03 -0700 (PDT) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id WAA80974; Thu, 11 Jul 2002 22:20:28 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.6/8.11.6) id g6C5JoH36140; Thu, 11 Jul 2002 22:19:50 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200207120519.g6C5JoH36140@arch20m.dellroad.org> Subject: Re: mbuf external buffer reference counters In-Reply-To: <20020711222725.A5284@unixdaemons.com> "from Bosko Milekic at Jul 11, 2002 10:27:25 pm" To: Bosko Milekic Date: Thu, 11 Jul 2002 22:19:50 -0700 (PDT) Cc: Julian Elischer , Luigi Rizzo , freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Bosko Milekic writes: > > mbufs that referred to the same object were linked together. > > I forget the details exactly. maybe someone else can remember.. > > it did it without ref counts somehow.. > > Yes, this is in NetBSD still and it is very elegant. I remember > looking at this a long time ago but to be honest, the reason I didn't > implement it then first escaped me. However, thanks to David Malone's > awesome commit messages, I found it: > > rev 1.53 of sys/sys/mbuf.h, extract: > [...] > "NetBSD's system of linked lists of mbufs was cosidered, but Alfred > felt it would have locking issues when the kernel was made more > SMP friendly." > [...] > > I think it's almost clear now that there are, in fact, no SMP issues > with it (we don't do per-cluster locking, or anything ridiculous like > that), so unless Alfred has the reason again, I'll consider that method > again instead. Thanks for the constructive feedback. That's a cool idea.. haven't looked at NetBSD but am imagining the mbufs would be linked in a 'ring'. This works because you never care how many references are, just whether there's one or more than one, and this is easy to tell by examining the ring pointer. I.e., you never have to iterate through the entire ring. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message