Date: Wed, 12 Mar 2003 17:36:37 -0800 (PST) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 26802 for review Message-ID: <200303130136.h2D1abQr067328@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=26802 Change 26802 by peter@peter_daintree on 2003/03/12 17:36:12 IFC @26797 (part 2) Affected files ... .. //depot/projects/hammer/sys/kern/kern_exit.c#9 integrate .. //depot/projects/hammer/sys/kern/kern_resource.c#7 integrate Differences ... ==== //depot/projects/hammer/sys/kern/kern_exit.c#9 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94 - * $FreeBSD: src/sys/kern/kern_exit.c,v 1.201 2003/03/12 11:10:04 tjr Exp $ + * $FreeBSD: src/sys/kern/kern_exit.c,v 1.202 2003/03/13 00:57:47 tjr Exp $ */ #include "opt_compat.h" @@ -658,15 +658,14 @@ return (0); } + /* + * Remove other references to this process to ensure + * we have an exclusive reference. + */ sx_xlock(&allproc_lock); LIST_REMOVE(p, p_list); /* off zombproc */ sx_xunlock(&allproc_lock); - LIST_REMOVE(p, p_sibling); - /* - * Remove other references to this process to ensure - * we have an exclusive reference. - */ leavepgrp(p); sx_xunlock(&proctree_lock); ==== //depot/projects/hammer/sys/kern/kern_resource.c#7 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $FreeBSD: src/sys/kern/kern_resource.c,v 1.120 2003/03/12 11:24:41 tjr Exp $ + * $FreeBSD: src/sys/kern/kern_resource.c,v 1.121 2003/03/13 00:54:53 tjr Exp $ */ #include "opt_compat.h" @@ -98,21 +98,17 @@ switch (uap->which) { case PRIO_PROCESS: - if (uap->who == 0) { - mtx_lock_spin(&sched_lock); + if (uap->who == 0) low = td->td_ksegrp->kg_nice; - mtx_unlock_spin(&sched_lock); - } else { + else { p = pfind(uap->who); if (p == NULL) break; if (p_cansee(td, p) == 0) { - mtx_lock_spin(&sched_lock); FOREACH_KSEGRP_IN_PROC(p, kg) { if (kg->kg_nice < low) low = kg->kg_nice; } - mtx_unlock_spin(&sched_lock); } PROC_UNLOCK(p); } @@ -136,12 +132,10 @@ LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); if (!p_cansee(td, p)) { - mtx_lock_spin(&sched_lock); FOREACH_KSEGRP_IN_PROC(p, kg) { if (kg->kg_nice < low) low = kg->kg_nice; } - mtx_unlock_spin(&sched_lock); } PROC_UNLOCK(p); } @@ -157,12 +151,10 @@ PROC_LOCK(p); if (!p_cansee(td, p) && p->p_ucred->cr_uid == uap->who) { - mtx_lock_spin(&sched_lock); FOREACH_KSEGRP_IN_PROC(p, kg) { if (kg->kg_nice < low) low = kg->kg_nice; } - mtx_unlock_spin(&sched_lock); } PROC_UNLOCK(p); } @@ -297,19 +289,15 @@ * Only allow nicing if to more than the lowest nice. * e.g. nices of 4,3,2 allow nice to 3 but not 1 */ - mtx_lock_spin(&sched_lock); FOREACH_KSEGRP_IN_PROC(p, kg) { if (kg->kg_nice < low) low = kg->kg_nice; } - if (n < low && suser(td)) { - mtx_unlock_spin(&sched_lock); + if (n < low && suser(td)) return (EACCES); - } FOREACH_KSEGRP_IN_PROC(p, kg) { sched_nice(kg, n); } - mtx_unlock_spin(&sched_lock); return (0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303130136.h2D1abQr067328>