From owner-freebsd-hackers Tue May 18 5:29:55 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from implode.root.com (root.com [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 8E4FE14DB2 for ; Tue, 18 May 1999 05:28:58 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.8/8.8.5) with ESMTP id FAA20767; Tue, 18 May 1999 05:27:24 -0700 (PDT) Message-Id: <199905181227.FAA20767@implode.root.com> To: Marc Slemko Cc: hackers@FreeBSD.ORG Subject: Re: libkvm sucks In-reply-to: Your message of "Mon, 17 May 1999 22:37:23 PDT." From: David Greenman Reply-To: dg@root.com Date: Tue, 18 May 1999 05:27:24 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >The premise: libkvm is fatally flawed by design, and fixing it is not an >easy proposition. > >The reasoning: reading from kernel data structures without any locking has >obvious race conditions. > >This is why any identd that uses libkvm sucks and gets into loops all the >time, etc. > >This is why netstat will often bail out in the middle with kvm errors on a >busy machine with lots of TCP connections, especially if you slow it down >by doing hostname lookups. > >In fact, on BSDI systems I have even seen identd hang the entire machine >hard by reading from the wrong address that the IO APIC is mapped at (BSDI >maps it starting at 0xffff0000, which much worse than a random address >for accidental reads). > >In general, I'm no fan of the Linux style proc (by "Linux style" I mean >going crazy with the types of info there and the huge amount of formatting >done in the kernel), but in this case it can work a whole lot better, even >if it is somewhat less efficient. > >I'm sure this isn't a new problem, but I don't recall hearing of any >suggested solutions and I'm not aware of any alternative interface to get >the same info on FreeBSD. Anyone? Generally we've been moving towards using sysctl for reading kernel data. procfs/kernfs is usually the wrong tool for the job in most cases (my subjective opinion of course). -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project - http://www.freebsd.org Creator of high-performance Internet servers - http://www.terasolutions.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message