From owner-freebsd-net Fri Jul 12 4:26:55 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 7D79437B400 for ; Fri, 12 Jul 2002 04:26:53 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D6BE43E4A for ; Fri, 12 Jul 2002 04:26:53 -0700 (PDT) (envelope-from baka@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1921) id 0A6C3AE23A; Fri, 12 Jul 2002 04:26:53 -0700 (PDT) Date: Fri, 12 Jul 2002 04:26:53 -0700 From: Jon Mini To: Alfred Perlstein Cc: Archie Cobbs , Bosko Milekic , Julian Elischer , Luigi Rizzo , freebsd-net@FreeBSD.ORG Subject: Re: mbuf external buffer reference counters Message-ID: <20020712112653.GS55378@elvis.mu.org> References: <20020711222725.A5284@unixdaemons.com> <200207120519.g6C5JoH36140@arch20m.dellroad.org> <20020712064104.GG97638@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020712064104.GG97638@elvis.mu.org> User-Agent: Mutt/1.3.27i 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 On Thu, Jul 11, 2002 at 11:41:04PM -0700, Alfred Perlstein wrote: > > 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. > > That's true, but could someone explain how one can safely and > effeciently manipulate such a structure in an SMP environment? > > I'm not saying it's impossible, I'm just saying it didn't seem > intuative to me back then, as well as now. I'm probably speaking out of turn here (I have no idea what structure you all are talking about), but a monodirectional ring can be safely modified with a compare-and-exchange atomic operation. -- Jonathan Mini http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message