Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jan 2002 18:51:09 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Hyong-Youb Kim <hykim@cs.rice.edu>
Cc:        hackers@freebsd.org
Subject:   Re: another VM question
Message-ID:  <3C575F9D.DC8CC325@mindspring.com>
References:  <Pine.GSO.4.33.0201291005200.28168-100000@nevada.cs.rice.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Hyong-Youb Kim wrote:
> First off, for each open file, does the kernel keep a unique vnode
> structure? If so, will it have at most one vm_object reference at any
> time?

Yes and not.  It depends on what you mean by "for each open
file"; an open instance in user space is not the same thing
as an open instance in the kernel space is not the same as
an open instance in the system open file table is not the
same as an open instance in a device.


> I am guessing that mmaping a file will create vm_object with a vnode
> pager that references vnode. But then under what circumstances does
> vnode not have a valid vm_object?

If the file can not be mmap'ed at all because it is in an
FS for which there are no getpagesputpages routines, or if
the file reference is changed to "deadfs" as a means of
revoking access to it, without walking all the possible
references, then it won't have a valid vm_object.

For example, sockets and FIFOs *can not* have vm_object's.

Basically, a vm_object pointer is a reference for the in
memory copy of the contents of a backing store.  If there
is no backing store, and there is no anonymous memory,
then there is no vm_object.

You would do well to read Matt Dillon's article on the
FreeBSD VM system in Daemon News before asking further
questions; it will give you a better basis for asking,
and answer many questions before you can ask them.


> Well ... also ahh what is the difference between VMIO and non-VMIO? Does
> the latter just mean that phyio? You can smack my head if these questions
> are so dumb.

The VMIO means that the I/O is done through the paging
system (the VM), rather than via direct I/O.  It means
that the image is unified, coheremt, and, as a result,
may be shared between multiple processes.

Really, rea the Daemon News articles; it will let you
arrive at your destination much more quickly than asking
one or two questions at a time, which then lead to more
one or two at a time questions.

-- Terry

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?3C575F9D.DC8CC325>