From owner-freebsd-arch@FreeBSD.ORG Mon May 24 09:31:55 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 830BF16A4CE; Mon, 24 May 2004 09:31:55 -0700 (PDT) Received: from srv01.sparkit.no (srv01.sparkit.no [193.69.116.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA80643D2D; Mon, 24 May 2004 09:31:54 -0700 (PDT) (envelope-from eivind@FreeBSD.org) Received: from ws.nada ([193.69.114.88]) by srv01.sparkit.no (8.12.11/8.12.11) with ESMTP id i4OGUsiH019896; Mon, 24 May 2004 18:30:54 +0200 (CEST) (envelope-from eivind@FreeBSD.org) Received: from ws.nada (localhost [127.0.0.1]) by ws.nada (8.12.9/8.12.10) with ESMTP id i4OGS4RI008956; Mon, 24 May 2004 16:28:04 GMT (envelope-from eivind@ws.nada) Received: (from eivind@localhost) by ws.nada (8.12.9/8.12.10/Submit) id i4OGS3gE008955; Mon, 24 May 2004 16:28:03 GMT (envelope-from eivind) Date: Mon, 24 May 2004 16:28:02 +0000 From: Eivind Eklund To: Robert Watson Message-ID: <20040524162802.GB2476@FreeBSD.org> References: <200405210103.i4L13QWT068012@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: arch@FreeBSD.org Subject: Re: Network Stack Locking X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2004 16:31:55 -0000 On Fri, May 21, 2004 at 01:23:51PM -0400, Robert Watson wrote: > The other concern I have is whether the message queues get deep or not: > many of the benefits of message queues come when the queues allow > coallescing of context switches to process multiple packets. If you're > paying a context switch per packet passing through the stack each time you > cross a boundary, there's a non-trivial operational cost to that. I don't know what Matt has done here, but at least with the design we used for G2 (a private DFly-like project that John Dyson, I, and a few other people I don't know if want to be anonymous or not ran), this should not an issue. We used thread context passing with an API that contained putmsg_and_terminate() and message ports that automatically could spawn new handler threads. Effectively, a message-related context switch turned into "assemble everything I care about in a small package, reset the stack pointer, and go". The expectation was that this should end up with less overhead than function calls, as we could drop the call frames for "higher levels in the chain". We never got to the point where we could measure if it worked out that way in practice, though. Eivind.