From owner-p4-projects@FreeBSD.ORG Mon Sep 17 18:48:36 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0C08516A418; Mon, 17 Sep 2007 18:48:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B464216A4C7 for ; Mon, 17 Sep 2007 18:48:35 +0000 (UTC) (envelope-from zec@icir.org) Received: from xaqua.tel.fer.hr (xaqua.tel.fer.hr [161.53.19.25]) by mx1.freebsd.org (Postfix) with ESMTP id 8701A13C46A for ; Mon, 17 Sep 2007 18:48:35 +0000 (UTC) (envelope-from zec@icir.org) Received: by xaqua.tel.fer.hr (Postfix, from userid 20006) id F30839B649; Mon, 17 Sep 2007 20:48:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on xaqua.tel.fer.hr X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.7 Received: from localhost (imunes.tel.fer.hr [161.53.19.8]) by xaqua.tel.fer.hr (Postfix) with ESMTP id E68119B645; Mon, 17 Sep 2007 20:48:32 +0200 (CEST) From: Marko Zec To: Julian Elischer Date: Mon, 17 Sep 2007 20:48:28 +0200 User-Agent: KMail/1.9.7 References: <200708212351.l7LNpi6Q006480@repoman.freebsd.org> <46EEC18F.6000809@elischer.org> In-Reply-To: <46EEC18F.6000809@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709172048.29253.zec@icir.org> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 125520 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 18:48:36 -0000 On Monday 17 September 2007 20:03:59 Julian Elischer wrote: > Marko Zec wrote: > > http://perforce.freebsd.org/chv.cgi?CH=125520 > > > > Change 125520 by zec@zec_tpx32 on 2007/08/21 23:51:39 > > > > Given that ng_pipe nodes can be connected into arbitrary > > topologies, and therefore it is possible for ngp_rcvdata() > > to be recursively called from a single thread, it is > > necessary to explicitly allow for the ng_pipe_giant mutex > > to be recursively acquireable. > > OR use a different locking scheme. That's right, but I'm just wondering is there anything fundamentally wrong with lock recursing (both in general as well as in this particular case)? Marko > i.e. reference counts or something. > > > Affected files ... > > > > .. //depot/projects/vimage/src/sys/netgraph/ng_pipe.c#2 edit > > > > Differences ... > > > > ==== //depot/projects/vimage/src/sys/netgraph/ng_pipe.c#2 (text+ko) > > ==== > > > > @@ -1028,7 +1028,7 @@ > > error = EEXIST; > > else { > > mtx_init(&ng_pipe_giant, "ng_pipe_giant", NULL, > > - MTX_DEF); > > + MTX_DEF | MTX_RECURSE); > > LIST_INIT(&node_head); > > LIST_INIT(&hook_head); > > ds_handle = timeout((timeout_t *) &pipe_scheduler,