From owner-freebsd-arch@FreeBSD.ORG Thu Aug 18 01:40:56 2005 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org 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 D3B6D16A420; Thu, 18 Aug 2005 01:40:56 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9426743D46; Thu, 18 Aug 2005 01:40:56 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j7I1euH8080957; Wed, 17 Aug 2005 18:40:56 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j7I1euEq080956; Wed, 17 Aug 2005 18:40:56 -0700 (PDT) (envelope-from rizzo) Date: Wed, 17 Aug 2005 18:40:56 -0700 From: Luigi Rizzo To: John Baldwin Message-ID: <20050817184056.A72643@xorpc.icir.org> References: <42F9ECF2.8080809@freebsd.org> <200508170836.05861.jhb@FreeBSD.org> <20050817093332.A85431@xorpc.icir.org> <200508171328.29654.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200508171328.29654.jhb@FreeBSD.org>; from jhb@FreeBSD.org on Wed, Aug 17, 2005 at 01:28:28PM -0400 Cc: gnn@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: Special schedulers, one CPU only kernel, one only userland X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2005 01:40:57 -0000 On Wed, Aug 17, 2005 at 01:28:28PM -0400, John Baldwin wrote: ... > fxp(4)'s locking is somewhat buggy where you are looking probably. I think > I've already committed the fixes to HEAD so that detach() is less > discouraging (we just lock fxp_stop() in detach now). The calls to well, my specific concern with the detach routine (but I was wrong, at least on this part) was that dropping the lock could cause the struct to go away while the interrupt handler was working on it. Now i see that this should be safe because bus_teardown_intr() blocks until we are out of the handler (the comment "Unhook interrupt before dropping lock." is probably stale...), and given that the detach() handler runs under giant and we cannot have multiple instances of it, at least this path seems safe. However I am still unclear on what happens if a detach() is racing with the output path (leading to fxp_start()). cheers luigi