From owner-freebsd-arch Thu Dec 7 19:35:52 2000 From owner-freebsd-arch@FreeBSD.ORG Thu Dec 7 19:35:50 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (Postfix) with ESMTP id 9E8BD37B400 for ; Thu, 7 Dec 2000 19:35:42 -0800 (PST) Received: (from daemon@localhost) by smtp04.primenet.com (8.9.3/8.9.3) id UAA15393; Thu, 7 Dec 2000 20:31:27 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp04.primenet.com, id smtpdAAAB0aW.D; Thu Dec 7 20:31:23 2000 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id UAA02960; Thu, 7 Dec 2000 20:35:26 -0700 (MST) From: Terry Lambert Message-Id: <200012080335.UAA02960@usr08.primenet.com> Subject: Re: Getting Kernel Process Information To: bright@wintelcom.net (Alfred Perlstein) Date: Fri, 8 Dec 2000 03:35:26 +0000 (GMT) Cc: mckusick@mckusick.com (Kirk McKusick), arch@FreeBSD.ORG In-Reply-To: <20001207115616.V16205@fw.wintelcom.net> from "Alfred Perlstein" at Dec 07, 2000 11:56:16 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: tlambert@usr08.primenet.com Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [ ... reorg of proc structure to keep it from being a PITA ... ] > I completely agree that should be done. My suggestion is to > completely rip out and kernel structs being passed through > this interface, the reason is that we will need mutexes in > a lot of them and we don't want to export that to userland. Let me remind you that copying data out of /dev/kmem into user space from structures like this is inherenetly MP-unsafe. Without holding the mutex, you can not guarantee that the structure contents will not change out from under the user space process while it is in the middle of copying them out. Ignoring the obvious things, like divide-by-zero errors, this is mostly a problem for programs trying to do list traversal, as opposed to particular data objects (unless they contain pointers themselves). Right now, the BGL protects us from this. Please do not build a soloution which will not work on MP systems, once the BGL is removed. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message