From owner-freebsd-current@FreeBSD.ORG Sun Oct 2 23:36:58 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0564A16A41F for ; Sun, 2 Oct 2005 23:36:58 +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 AC05643D45 for ; Sun, 2 Oct 2005 23:36:57 +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 j92NaogU016869 for ; Sun, 2 Oct 2005 16:36:54 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200510022336.j92NaogU016869@gw.catspoiler.org> Date: Sun, 2 Oct 2005 16:36:50 -0700 (PDT) From: Don Lewis To: current@FreeBSD.org In-Reply-To: <200510020908.j9298dAX014736@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: Subject: Re: patch review & testing request for fill_kinfo_proc() and friends X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2005 23:36:58 -0000 On 2 Oct, To: current@freebsd.org wrote: > Attached is a patch that fixes locking problems in fill_kinfo_proc() and > related functions. The patch is larger than I initially anticipated > because I had to refactor the code in order to get the locking right. > > I'd like to commit it to HEAD soon so that it can be MFC'ed in time for > 6.0-RC1, but it really needs review and testing of all the sysctl and > linprocfs functionality. This patch also applies cleanly to RELENG_6. [snip] I found and fixed a few whitespace nits and a minor buglet that didn't affect functionality. This patch has passed all of my testing, so I committed it to HEAD to give it wider exposure. ------ Forwarded message ------ From: Don Lewis Subject: cvs commit: src/sys/kern kern_proc.c Date: Sun, 2 Oct 2005 23:27:56 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org truckman 2005-10-02 23:27:56 UTC FreeBSD src repository Modified files: sys/kern kern_proc.c Log: Always wire the sysctl output buffer in sysctl_kern_proc() before calling sysctl_out_proc(). -- fix from jhb Move the code in fill_kinfo_thread() that gathers data from struct proc into the new function fill_kinfo_proc_only(). Change all callers of fill_kinfo_thread() to call both fill_kinfo_proc_only() and fill_kinfo() thread. When gathering data from a multi-threaded process, fill_kinfo_proc_only() only needs to be called once. Grab sched_lock before accessing the process thread list or calling fill_kinfo_thread(). PR: kern/84684 MFC after: 3 days Revision Changes Path 1.232 +113 -95 src/sys/kern/kern_proc.c