From owner-freebsd-emulation@FreeBSD.ORG Tue Aug 15 23:46:07 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 120B216A4DF for ; Tue, 15 Aug 2006 23:46:07 +0000 (UTC) (envelope-from uucp@brian.han.de) Received: from baghira.han.de (baghira.han.de [62.48.90.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id A747543D8C for ; Tue, 15 Aug 2006 23:44:51 +0000 (GMT) (envelope-from uucp@brian.han.de) Received: by baghira.han.de (Postfix, from userid 10) id EFD36CDA44; Wed, 16 Aug 2006 01:44:46 +0200 (MEST) Received: (qmail 16053 invoked by uid 10); 16 Aug 2006 01:38:14 -0000 MBOX-Line: From owner-freebsd-current@freebsd.org Tue Aug 15 18:31:35 2006 Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by baghira.han.de (Postfix) with ESMTP id 7E765CDA22 for ; Tue, 15 Aug 2006 18:31:34 +0200 (MEST) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id DFC38728EE; Tue, 15 Aug 2006 16:30:51 +0000 (GMT) (envelope-from owner-freebsd-current@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id D6A4716A632; Tue, 15 Aug 2006 16:30:39 +0000 (UTC) (envelope-from owner-freebsd-current@freebsd.org) X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 08CBF16A589; Tue, 15 Aug 2006 16:30:29 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id D05B743E5F; Tue, 15 Aug 2006 16:27:58 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.7/8.13.7) with ESMTP id k7FGRrSA062366 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 15 Aug 2006 18:27:53 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.7/8.13.3/Submit) id k7FGRrr9062365; Tue, 15 Aug 2006 18:27:53 +0200 (CEST) Date: Tue, 15 Aug 2006 18:27:53 +0200 From: Divacky Roman To: John Baldwin Message-ID: <20060815162753.GA62266@stud.fit.vutbr.cz> References: <20060814170418.GA89686@stud.fit.vutbr.cz> <200608151101.30951.jhb@freebsd.org> <44E1E64F.6020205@FreeBSD.org> <200608151149.20338.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200608151149.20338.jhb@freebsd.org> User-Agent: Mutt/1.4.2i X-Scanned-By: MIMEDefang 2.54 on 147.229.10.14 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-freebsd-current@freebsd.org Errors-To: owner-freebsd-current@freebsd.org Cc: emulation@freebsd.org, freebsd-current@freebsd.org, Suleiman Souhlal Subject: Re: SoC: linuxolator update: first patch X-BeenThere: freebsd-emulation@freebsd.org List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 23:46:07 -0000 On Tue, Aug 15, 2006 at 11:49:19AM -0400, John Baldwin wrote: > On Tuesday 15 August 2006 11:20, Suleiman Souhlal wrote: > > John Baldwin wrote: > > > > > >>+ KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); > > >>+ } > > >>+ > > >>+ em->child_clear_tid = NULL; > > >>+ em->child_set_tid = NULL; > > >>+ > > >>+ /* allocate the shared struct only in clone()/fork cases > > >>+ * in the case of clone() td = calling proc and child = pid of > > >>+ * the newly created proc > > >>+ */ > > >>+ if (child != 0) { > > >>+ if (flags & CLONE_VM) { > > >>+ /* lookup the parent */ > > >>+ p_em = em_find(td->td_proc, EMUL_LOCKED); > > >>+ KASSERT(p_em != NULL, ("proc_init: parent emuldata not found for > > >>CLONE_VM\n")); > > >>+ em->shared = p_em->shared; > > >>+ em->shared->refs++; > > >> > > >>This is unsafe. Please use the functions in sys/refcount.h. > > > > > > > > > Well, in this case he's already holding a lock. If he always holds a lock > > > when accessing and modifying refs, then refcount_*() would only add > overhead. > > > > Isn't he holding the wrong lock (emul_lock vs emul_shared_lock)? > > Maybe. I think those should be merged into one lock anyway. :) it used to be one lock, but it caused more problems then now... pls, let me fix all the issue and then judge, ok? :) _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"