Date: Wed, 12 Mar 2008 10:06:28 +0000 (UTC) From: Vadim Goncharov <vadim_nuclight@mail.ru> To: freebsd-arch@freebsd.org Subject: sysctl vs procfs Message-ID: <slrnftfap4.1m0l.vadim_nuclight@hostel.avtf.net>
next in thread | raw e-mail | index | archive | help
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]
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?slrnftfap4.1m0l.vadim_nuclight>