From owner-freebsd-hackers Mon Aug 3 04:07:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA07630 for freebsd-hackers-outgoing; Mon, 3 Aug 1998 04:07:51 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA07625 for ; Mon, 3 Aug 1998 04:07:49 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id EAA06741; Mon, 3 Aug 1998 04:04:46 -0700 (PDT) Message-Id: <199808031104.EAA06741@implode.root.com> To: Doug Rabson cc: zhihuizhang , hackers Subject: Re: Relationship between buf/page/vnode/object? In-reply-to: Your message of "Mon, 03 Aug 1998 10:52:38 BST." From: David Greenman Reply-To: dg@root.com Date: Mon, 03 Aug 1998 04:04:46 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >On Sun, 2 Aug 1998, zhihuizhang wrote: > >> >> After studying VM source code for two months, I have understood the >> general ideas in it. All the pages (vm_page structures) belong to a >> object/pindex pair and virtual memory/physical memory is decoupled by >> introducing the VM object. >> >> What confuses me now is that vnode and buf structures can also have pages >> (vm_page structures) associated with them. But file system cache and VM >> cache are unified and should have a consistent interface. I mean all pages >> should only hang off the vm_object structures. >> >> I hope that someone can describe the relationship of these important >> structures (vm_object, vm_page, vnode, buf) briefly for me. I have >> searched the MailingList Archive in vain. >> >> Any help is appreciated. > >As far as I know, the pages which are held in buf structures are 'owned' >by a unique vm_object. This object holds cached pages for a vnode and has >an associated vnode_pager. The buf just provides a convenient way of >performing 'regular' i/o into the same pages as those used for VM. That's mostly correct. Struct bufs are just kernel virtual mappings of vm_page's. Directories are handled differently, however - the system mallocs buffers for those, rather than whole pages, in order to be more space efficient. This isn't a problem since one can't mmap a directory. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message