From owner-freebsd-hackers Tue Dec 18 11:11: 4 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id A31A537B417 for ; Tue, 18 Dec 2001 11:11:00 -0800 (PST) Received: from onyx (onyx.cs.binghamton.edu [128.226.140.171]) by bingnet2.cc.binghamton.edu (8.11.6/8.11.6) with ESMTP id fBIJAvK16466; Tue, 18 Dec 2001 14:10:57 -0500 (EST) Date: Tue, 18 Dec 2001 14:10:42 -0500 (EST) From: Zhihui Zhang X-Sender: zzhang@onyx To: Matthew Dillon Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: A quick VM question In-Reply-To: <200112180855.fBI8tIb68150@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Now I know FreeBSD could defer creating an VM object until the last minute - when the page fault occurs. Thanks. -Zhihui On Tue, 18 Dec 2001, Matthew Dillon wrote: > > :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 > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message