From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 2 23:40:30 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 E4E6C16A41F; Sun, 2 Oct 2005 23:40:30 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B80A43D45; Sun, 2 Oct 2005 23:40:30 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id j92NeKWw016881; Sun, 2 Oct 2005 16:40:24 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200510022340.j92NeKWw016881@gw.catspoiler.org> Date: Sun, 2 Oct 2005 16:40:20 -0700 (PDT) From: Don Lewis To: jhb@FreeBSD.org In-Reply-To: <200510020857.j928veaV014700@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: freebsd-hackers@FreeBSD.org, rwatson@FreeBSD.org, apelisse@gmail.com 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: Sun, 02 Oct 2005 23:40:31 -0000 On 2 Oct, Don Lewis wrote: > It turns out that fill_kinfo_thread() grabs a bunch of locks to grab > things out of struct proc, which breaks badly if sched_lock is grabbed > before calling fill_kinfo_thread(). > > I refactored fill_kinfo_thread() into two functions, one of which > doesn't need any additional locks and only gathers per-thread data, and > a new function, fill_kinfo_proc_only(), which gathers the data that is > common to all theads and can be called before grabbing sched_lock. This > should be more efficient if there is more than one thread because the > per-process data is only gathered once, and only the per-thread data in > kinfo_proc is overwritten for each thread. [ snip ] After fixing a few whitespace nits and one minor buglet, I commited my patch to HEAD, in kern_proc.c 1.232. I hope to be able to MFC it soon.