From owner-freebsd-hackers Mon Jan 13 12:10:41 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77C8637B401; Mon, 13 Jan 2003 12:10:39 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E9FF43F13; Mon, 13 Jan 2003 12:10:39 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.6/8.12.6) with ESMTP id h0DKAaYp030884; Mon, 13 Jan 2003 12:10:38 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.6/8.12.6/Submit) id h0DKAawp030883; Mon, 13 Jan 2003 12:10:36 -0800 (PST) Date: Mon, 13 Jan 2003 12:10:36 -0800 (PST) From: Matthew Dillon Message-Id: <200301132010.h0DKAawp030883@apollo.backplane.com> To: John Baldwin Cc: rwatson@FreeBSD.org, hackers@FreeBSD.org Subject: Re: RE: possible cpu_wait() / vm_waitproc() / MAC problem References: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : : :On 12-Jan-2003 Matthew Dillon wrote: :> While working on an MFC I noticed that sys/compat/svr4/svr4_misc.c :> (in CURRENT) is calling cpu_wait() in svr4_sys_waitsys() instead of :> vm_waitproc(). I believe it needs to call vm_waitproc(). Can anyone :> say for sure? :> :> Also, in kern/kern_exit.c the wait code has this: :> :>#ifdef MAC :> mac_destroy_proc(p) :>#endif :> :> This appears to be missing from svr4_sys_waitsys() as well, also :> in -current. Could someone confirm that? : :The svr4() wait code is just gross. We need to make it just pass a flag :into wait1() IMO and have the svr4() implementation be a wrapper function. : :-- : :John Baldwin <>< http://www.FreeBSD.org/~jhb/ :"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ Well, I would prefer to just fix the bug(s) for now, unless someone else wants to have a go at merging it. I have major work on vmapbuf() and friends that I need to do that I don't want to delay it too much longer. Does this patch look good? -Matt Matthew Dillon Index: compat/svr4/svr4_misc.c =================================================================== RCS file: /home/ncvs/src/sys/compat/svr4/svr4_misc.c,v retrieving revision 1.56 diff -u -r1.56 svr4_misc.c --- compat/svr4/svr4_misc.c 13 Jan 2003 00:28:57 -0000 1.56 +++ compat/svr4/svr4_misc.c 13 Jan 2003 20:09:38 -0000 @@ -1377,12 +1377,15 @@ * to free anything that cpu_exit couldn't * release while still running in process context. */ - cpu_wait(q); + vm_waitproc(q); #if defined(__NetBSD__) pool_put(&proc_pool, q); #endif #ifdef __FreeBSD__ mtx_destroy(&q->p_mtx); +#ifdef MAC + mac_destroy_proc(q); +#endif uma_zfree(proc_zone, q); #endif nprocs--; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message