Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Aug 1998 04:04:46 -0700
From:      David Greenman <dg@root.com>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        zhihuizhang <bf20761@binghamton.edu>, hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Relationship between buf/page/vnode/object? 
Message-ID:  <199808031104.EAA06741@implode.root.com>
In-Reply-To: Your message of "Mon, 03 Aug 1998 10:52:38 BST." <Pine.BSF.4.01.9808031048440.14391-100000@herring.nlsystems.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808031104.EAA06741>