Date: Tue, 18 Dec 2001 00:55:18 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Zhihui Zhang <zzhang@cs.binghamton.edu> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: A quick VM question Message-ID: <200112180855.fBI8tIb68150@apollo.backplane.com> References: <Pine.SOL.4.21.0112162202390.21554-100000@opal>
next in thread | previous in thread | raw e-mail | index | archive | help
:What are the backing objects of the stack and heap area of a process's
:address space? When are they created? I saw the code vm_map_insert(), but
:the object argument given is NULL.
:
:Thanks,
:
:-Zhihui
The backing objects are OBJT_DEFAULT objects. They are typically created
when the system first needs to retrieve the map entry's object or needs to
clip the map entry (for example, when extending the stack or
[s]brk()ing), so as to reduce the number of actual VM objects created and
to share the same VM object (with different offsets) whenever possible.
If you look in vm/vm_map.c that is what all those NULL tests and calls
to vm_object_allocate(OBJT_DEFAULT, ...) do.
An OBJT_DEFAULT object is effectively a swap-backed object, just one
that does not yet have any swap associated with it. If/When the
system decides it needs to swap it will convert OBJT_DEFAULT objects
for the memory in question to OBJT_SWAP objects. The two are really
almost the same type of VM object. The type distinction is simply used
to optimize performance.
The main VM object types are:
OBJT_PHYS physically-backed, never swapped out.
OBJT_DEFAULT swap-backed with no swap yet assigned
OBJT_SWAP swap-backed
OBJT_VNODE vnode (e.g. file) backed object
-Matt
Matthew Dillon
<dillon@backplane.com>
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?200112180855.fBI8tIb68150>
