Date: Wed, 18 Apr 2001 09:52:25 -0400 (EDT) From: Robert Watson <rwatson@FreeBSD.ORG> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: Kirk McKusick <mckusick@mckusick.com>, Julian Elischer <julian@elischer.org>, Rik van Riel <riel@conectiva.com.br>, freebsd-hackers@FreeBSD.ORG, Matt Dillon <dillon@earth.backplane.com>, David Xu <bsddiy@21cn.com> Subject: Re: vm balance Message-ID: <Pine.NEB.3.96L.1010418094428.2462A-100000@fledge.watson.org> In-Reply-To: <33029.987575619@critter>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 18 Apr 2001, Poul-Henning Kamp wrote: > In message <200104180540.WAA58303@beastie.mckusick.com>, Kirk McKusick writes: > > >Every vnode in the system has an associated object. > > No: device vnodes dont... > > I think the correct solution to that is to move devices away from vnodes > and into the fdesc layer, just like fifo's and sockets. I dislike that idea for a number of reasons, not least of which is that introducing more and more file-descriptor level objects increases the complexity of the system call service implementation, and duplicates code. If we're going to pretend that everything in the system is a file, and most people seem willing to accept that, acting on devices through vnodes seems like a reasonable choice. The vnode provides us with a notion of open/close, reference counting, access to a generic vnode pager for memory mapping of objects without specific memory mapping characteristics, and so on. Right now, the mapping from vnodes into devices is a bit poor due to some odd reference / open / close behavior, and due to a lack of a notion of stateful access to vnodes (there have been a number of proposals to remedy this, however). The vnode is our abstraction for objects that have address spaces, can be opened/closed and retain a seeking position, can be mapped, have protections, etc, etc. It may not be a perfect representation of a device, but it does a reasonable job. Besides which, the kernel knows how to act on vnodes, and there is plenty of precedent for the kernel opening vnodes and keeping around references for its own ends, but there isn't all that much precedent for the kernel doing this using file descriptors :-). Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1010418094428.2462A-100000>