From owner-freebsd-arch@FreeBSD.ORG Wed Mar 12 10:06:44 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3979C1065670 for ; Wed, 12 Mar 2008 10:06:44 +0000 (UTC) (envelope-from freebsd-arch@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id E70A48FC1D for ; Wed, 12 Mar 2008 10:06:43 +0000 (UTC) (envelope-from freebsd-arch@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JZNr4-0006B8-4T for freebsd-arch@freebsd.org; Wed, 12 Mar 2008 10:06:38 +0000 Received: from 195.208.174.178 ([195.208.174.178]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Mar 2008 10:06:38 +0000 Received: from vadim_nuclight by 195.208.174.178 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Mar 2008 10:06:38 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-arch@freebsd.org From: Vadim Goncharov Date: Wed, 12 Mar 2008 10:06:28 +0000 (UTC) Organization: Nuclear Lightning @ Tomsk, TPU AVTF Hostel Lines: 23 Message-ID: X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 195.208.174.178 X-Comment-To: All User-Agent: slrn/0.9.8.1 (FreeBSD) Sender: news Subject: sysctl vs procfs X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vadim_nuclight@mail.ru List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2008 10:06:44 -0000 Hi! While it is good idea to prefer more consistent sysctl in favor of procfs, the sysctl interface has some drawbacks. For example, procfs has good file interface for big things, like VM map of the process. Imagine 800 megs... and sysctl in-kernel interface locks value then copies it to in-kernel memory then it can be copied to userspace. Not suitable for providing alternative to procfs in reading big files and getting rid of procfs, of course. So, what about adding sysctl interfaces allowing userland-application to read large buffers in parts without copying? Application, of course, should be aware of the fact that underlying buffer can change while copying, but many our base utilities (like netstat) already work in these conditions. Another proposal is about human-readable conversions. We already have C structs and arrays parsing/unparsing code in netgraph (/sys/netgraph/ng_parse.c). What about porting it userland (or leave in kernel, this should be thought) to allow user-interpreting blobs which are even hidden to user without sysctl -A ? This and previous can improve our KVM interactions, I think. -- WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru [Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight]