From owner-freebsd-smp Sun Dec 17 13:13:52 2000 From owner-freebsd-smp@FreeBSD.ORG Sun Dec 17 13:13:50 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 48DAF37B402 for ; Sun, 17 Dec 2000 13:13:49 -0800 (PST) Received: from pretoria-05.budapest.interware.hu ([195.70.53.69] helo=elischer.org) by mail.interware.hu with esmtp (Exim 3.16 #1 (Debian)) id 147l7q-0007mx-00; Sun, 17 Dec 2000 22:13:47 +0100 Sender: julian@FreeBSD.ORG Message-ID: <3A3D2894.CEA08776@elischer.org> Date: Sun, 17 Dec 2000 12:56:52 -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: Chuck Paterson Cc: smp@FreeBSD.ORG Subject: Re: Netgraph locking primatives. take 1. References: <200012171849.eBHInbP14473@berserker.bsdi.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Chuck Paterson wrote: > > Julian > > The release (leave_{read,write}) operations don't have anything > to actually run the queues. What mechanism do you plan to use > dequeue the stuff which is backed up on the queueu. For instance > 20 read operatons backed up while a write was held. > > Chuck you loop on the dequeue after having been called in some manner the release is if you have finished processing a packet, approximate pseudocode follows: [called from interrupt driven driver with packet to process] packet = aquire_read(node->lock, packet) /* May not get same packet */ if (!packet) return; node->rcvdata(node,packet) release_reader(node->lock) /* * now we've handled the packet we brought, (or a friend of it) * let's look for any other packets that may have been queued up */ for (;;) { if ((node->lock.flags & (WRITE_PENDING|READ_PENDING)) == 0) return; mtx_get(node->lock.mtx, MTX_SPIN) packet = dequeue(node->lock) /* dequeue aquires and adjusts the locks as it dequeues packets */ mtx_exit(..) if (!packet) { return node->rcvdata(node,packet) release_reader(node->lock) } -- __--_|\ 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