From owner-freebsd-smp Fri Dec 8 16: 4: 5 2000 From owner-freebsd-smp@FreeBSD.ORG Fri Dec 8 16:04:02 2000 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from mail.interware.hu (mail.interware.hu [195.70.32.130]) by hub.freebsd.org (Postfix) with ESMTP id 5817637B6A6; Fri, 8 Dec 2000 16:04:00 -0800 (PST) Received: from monrovia-14.budapest.interware.hu ([195.70.53.206] helo=elischer.org) by mail.interware.hu with esmtp (Exim 3.16 #1 (Debian)) id 144XUb-0003WN-00; Sat, 09 Dec 2000 01:03:57 +0100 Sender: julian@FreeBSD.ORG Message-ID: <3A3176D2.C3587387@elischer.org> Date: Fri, 08 Dec 2000 16:03:30 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Poul-Henning Kamp Cc: Chuck Paterson , Mike Smith , smp@FreeBSD.ORG Subject: Re: Netgraph and SMP References: <80663.976310686@critter> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Poul-Henning Kamp wrote: > > In message <200012082121.eB8LLSQ07456@berserker.bsdi.com>, Chuck Paterson write > s: > > > >For uses such as barriers for loading and unloading it is > >possible to have the counters and entry barriers all PCPU. You can then > >use more complex mechanisms to set the low level barrier and interrogate > >the counters. Terry ->>may<<- view this as another way of doing > >what he is suggesting. > > The thing that has me worried here is that using locking (as opposed > to atomic ops) in netgraph means that will expose netgraph paths to > heavy-duty locking synchronism, since TCP, UDP, IP, Mbuf will also > use a (separate) locking domain. My aim is to have as little locking as possible. (You should know since I've been CCing you for some of the discussions archie and I were having) The difficulty comes with trying to not fall off the edge of the world when a node or link is reconfigured while data is transiting through the system. At the moment I'm using reference counts and VALID/INVALID flags to stop things from disapearing out from under running code, but the boundary conditions are really difficult. It's easy to stop a node from going away while the packeet is fairly and squarly in teh node's control, but the problem occurs when a packet is transitionning from one node to another. There are race conditions all over the place. I think that some simple spinlocks can remove those race conditions but I'd like to use locks that allow more than one packet at a time to transition through a node or graph. This implies a reader/writer lock, as Mike Smith pointed out. Anyhow it's all theoretical at the moment as I'm still only drawing on paper napkins at this stage. (BTW any productive suggestions would be welcome) > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-smp" in the body of the message -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ presently in: Budapest v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message