From owner-p4-projects@FreeBSD.ORG Sat Oct 13 12:58:08 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 50A2F16A46B; Sat, 13 Oct 2007 12:58:08 +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 EB73616A41A for ; Sat, 13 Oct 2007 12:58:07 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CE26813C46E for ; Sat, 13 Oct 2007 12:58:07 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l9DCw7tE012497 for ; Sat, 13 Oct 2007 12:58:07 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l9DCw7G6012494 for perforce@freebsd.org; Sat, 13 Oct 2007 12:58:07 GMT (envelope-from zec@FreeBSD.org) Date: Sat, 13 Oct 2007 12:58:07 GMT Message-Id: <200710131258.l9DCw7G6012494@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 127476 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: Sat, 13 Oct 2007 12:58:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=127476 Change 127476 by zec@zec_tpx32 on 2007/10/13 12:57:17 Simplify previous change - there's no need for sched_lock mtx to be visible outside of kern/sched_4bsd.c. Affected files ... .. //depot/projects/vimage/src/sys/kern/kern_exit.c#10 edit .. //depot/projects/vimage/src/sys/kern/kern_vimage.c#42 edit .. //depot/projects/vimage/src/sys/kern/sched_4bsd.c#14 edit .. //depot/projects/vimage/src/sys/sys/sched.h#7 edit Differences ... ==== //depot/projects/vimage/src/sys/kern/kern_exit.c#10 (text+ko) ==== @@ -414,13 +414,11 @@ LIST_REMOVE(p, p_list); LIST_INSERT_HEAD(&zombproc, p, p_list); LIST_REMOVE(p, p_hash); -#if defined(VIMAGE) && defined(SCHED_4BSD) +#if defined(VIMAGE) && defined(SCHED_4BSD) /* XXX what about ULE? */ if (p->p_ucred->cr_vimage->v_procg != p->p_pptr->p_ucred->cr_vimage->v_procg) { - mtx_lock_spin(&sched_lock); sched_load_reassign(p->p_ucred->cr_vimage->v_procg, p->p_pptr->p_ucred->cr_vimage->v_procg); - mtx_unlock_spin(&sched_lock); } #endif sx_xunlock(&allproc_lock); ==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#42 (text+ko) ==== @@ -530,14 +530,8 @@ sx_xlock(&allproc_lock); oldcred->cr_vimage->v_procg->nprocs--; p->p_ucred->cr_vimage->v_procg->nprocs++; -#if defined(VIMAGE) && defined(SCHED_4BSD) - mtx_lock_spin(&sched_lock); -#endif sched_load_reassign(oldcred->cr_vimage->v_procg, newcred->cr_vimage->v_procg); -#if defined(VIMAGE) && defined(SCHED_4BSD) - mtx_unlock_spin(&sched_lock); -#endif sx_xunlock(&allproc_lock); crfree(oldcred); break; ==== //depot/projects/vimage/src/sys/kern/sched_4bsd.c#14 (text+ko) ==== @@ -104,7 +104,7 @@ ((ts)->ts_runq != 0 && (ts)->ts_runq != &runq) static struct td_sched td_sched0; -struct mtx sched_lock; +static struct mtx sched_lock; #ifndef VIMAGE static int sched_tdcnt; /* Total runnable threads in the system. */ @@ -255,9 +255,10 @@ void sched_load_reassign(struct vprocg *old, struct vprocg *new) { - /* XXX locking? */ + mtx_lock_spin(&sched_lock); old->_sched_tdcnt--; new->_sched_tdcnt++; + mtx_unlock_spin(&sched_lock); } #endif ==== //depot/projects/vimage/src/sys/sys/sched.h#7 (text+ko) ==== @@ -179,8 +179,6 @@ #define SCHED_STAT_INC(var) #endif -extern struct mtx sched_lock; - /* temporarily here */ void schedinit(void); void sched_newproc(struct proc *p, struct thread *td);