Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2007 22:54:45 +0100
From:      Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To:        Attilio Rao <attilio@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 114200 for review
Message-ID:  <20070207215445.GA69385@stud.fit.vutbr.cz>
In-Reply-To: <3bbf2fe10702071250p65989b81v9872ff7203c92b91@mail.gmail.com>
References:  <200702071858.l17IwBGj041287@repoman.freebsd.org> <3bbf2fe10702071250p65989b81v9872ff7203c92b91@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 07, 2007 at 09:50:08PM +0100, Attilio Rao wrote:
> 2007/2/7, Roman Divacky <rdivacky@freebsd.org>:
> >http://perforce.freebsd.org/chv.cgi?CH=114200
> >
> >Change 114200 by rdivacky@rdivacky_witten on 2007/02/07 18:57:25
> >
> >       Move the free() out of the emul_shared_lock coverage as its not
> >       sleepable lock anymore.
> >
> >Affected files ...
> >
> >.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#35 edit
> >
> >Differences ...
> >
> >==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#35 
> >(text+ko) ====
> >
> >@@ -187,9 +187,11 @@
> >       LIST_REMOVE(em, threads);
> >
> >       em->shared->refs--;
> >-       if (em->shared->refs == 0)
> >+       if (em->shared->refs == 0) {
> >+               EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >               free(em->shared, M_LINUX);
> >-       EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >+       } else
> >+               EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >
> >       if (child_clear_tid != NULL) {
> >               struct linux_sys_futex_args cup;
> >@@ -274,9 +276,11 @@
> >               PROC_UNLOCK(p);
> >
> >               em->shared->refs--;
> >-               if (em->shared->refs == 0)
> >+               if (em->shared->refs == 0) {
> >+                       EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >                       free(em->shared, M_LINUX);
> >-               EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >+               } else
> >+                       EMUL_SHARED_WUNLOCK(&emul_shared_lock);
> >
> >               free(em, M_LINUX);
> >       }
> >
> 
> Would you convert em->shared->refs with a refcount() ? (sys/refcount.h)

as we discussed. its not much of a use in this particular case
as I have to lock anyway so this doesnt buy us much.

thnx, roman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070207215445.GA69385>