Date: Mon, 29 Jan 2007 20:33:31 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 113673 for review Message-ID: <200701292033.l0TKXV0g009634@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113673 Change 113673 by rdivacky@rdivacky_witten on 2007/01/29 20:33:26 o dont set p->p_emuldata to NULL when the process is exiting. it doesnt make any sense and only costs us 2 mtx operations. o dont lock emul_data to unlock it on the very next line. it doesnt serve any purpose and only slow things down. There might be race though, I am not sure and this needs some checking. Add a comment about it. Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#27 edit Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#27 (text+ko) ==== @@ -167,10 +167,6 @@ EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_REMOVE(em, threads); - PROC_LOCK(p); - p->p_emuldata = NULL; - PROC_UNLOCK(p); - em->shared->refs--; if (em->shared->refs == 0) free(em->shared, M_LINUX); @@ -241,12 +237,15 @@ && p->p_sysent == &elf_linux_sysvec)) { struct linux_emuldata *em; - em = em_find(p, EMUL_DOLOCK); + /* + * XXX: is it racy? if p->p_sysent still points at linux_sysvec + * it is. someone please check this. we were running with + * this race for quite a long time though. + */ + em = em_find(p, EMUL_DONTLOCK); KASSERT(em != NULL, ("proc_exec: emuldata not found.\n")); - EMUL_UNLOCK(&emul_lock); - EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_REMOVE(em, threads);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701292033.l0TKXV0g009634>