Date: Tue, 15 Aug 2006 18:27:53 +0200 From: Divacky Roman <xdivac02@stud.fit.vutbr.cz> To: John Baldwin <jhb@freebsd.org> Cc: emulation@freebsd.org, freebsd-current@freebsd.org, Suleiman Souhlal <ssouhlal@freebsd.org> Subject: Re: SoC: linuxolator update: first patch Message-ID: <20060815162753.GA62266@stud.fit.vutbr.cz> In-Reply-To: <200608151149.20338.jhb@freebsd.org> References: <20060814170418.GA89686@stud.fit.vutbr.cz> <200608151101.30951.jhb@freebsd.org> <44E1E64F.6020205@FreeBSD.org> <200608151149.20338.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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? :)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060815162753.GA62266>
