From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 3 14:02:12 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 94D2116A41F for ; Mon, 3 Oct 2005 14:02:12 +0000 (GMT) (envelope-from rob@hudson-trading.com) Received: from daemon.mistermishap.net (167-49.nyc.dsl.access.net [166.84.167.49]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB3A143D45 for ; Mon, 3 Oct 2005 14:02:11 +0000 (GMT) (envelope-from rob@hudson-trading.com) Received: from daemon.mistermishap.net (localhost.mistermishap.net [127.0.0.1]) by daemon.mistermishap.net (8.12.9/8.12.9) with ESMTP id j93E2BmU090573; Mon, 3 Oct 2005 10:02:11 -0400 (EDT) (envelope-from rob@hudson-trading.com) Received: from localhost (rob@localhost) by daemon.mistermishap.net (8.12.9/8.12.9/Submit) with ESMTP id j93E2Bjr090570; Mon, 3 Oct 2005 10:02:11 -0400 (EDT) X-Authentication-Warning: daemon.mistermishap.net: rob owned process doing -bs Date: Mon, 3 Oct 2005 10:02:11 -0400 (EDT) From: Rob Watt X-X-Sender: rob@daemon.mistermishap.net To: freebsd-hackers@freebsd.org Message-ID: <20051003095203.K90360@daemon.mistermishap.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailman-Approved-At: Tue, 04 Oct 2005 11:36:49 +0000 Cc: rob work , mikep@hudson-trading.com, Jason Carroll Subject: re: freebsd-5.4-stable panics X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2005 14:02:12 -0000 > It turns out that the sysctl buffer is already wired in one of the two > cases > that this function is called, so I moved the wiring up to the upper layer > in > the other case and cut out a bunch of the locking gymnastics as a result. > Can you try this patch? > > Index: kern_proc.c > =================================================================== > RCS file: /usr/cvs/src/sys/kern/kern_proc.c,v > retrieving revision 1.231 > diff -u -r1.231 kern_proc.c > --- kern_proc.c 27 Sep 2005 18:03:15 -0000 1.231 > +++ kern_proc.c 30 Sep 2005 17:04:57 -0000 > @@ -875,22 +875,16 @@ > > if (flags & KERN_PROC_NOTHREADS) { > fill_kinfo_proc(p, &kinfo_proc); > - PROC_UNLOCK(p); > error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, > sizeof(kinfo_proc)); > - PROC_LOCK(p); > } else { > - _PHOLD(p); > FOREACH_THREAD_IN_PROC(p, td) { > fill_kinfo_thread(td, &kinfo_proc); > - PROC_UNLOCK(p); > error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, > sizeof(kinfo_proc)); > - PROC_LOCK(p); > if (error) > break; > } > - _PRELE(p); > } > PROC_UNLOCK(p); > if (error) > @@ -932,6 +926,9 @@ > if (oid_number == KERN_PROC_PID) { > if (namelen != 1) > return (EINVAL); > + error = sysctl_wire_old_buffer(req, 0); > + if (error) > + return (error); > p = pfind((pid_t)name[0]); > if (!p) > return (ESRCH); John, We tried this patch and were able to run our simulations (and top) for 3 days straight without crashing. Since we were panicking every 3-6 hours before when running top, this seems to have fixed the problem. We noticed the patches from Don Lewis, but have not tested them yet. We weren't sure if we could just apply those patches against 6.0-BETA5, or whether we should wait for them to be MFC'd. - Rob Watt