Date: Tue, 18 Dec 2001 14:10:42 -0500 (EST) From: Zhihui Zhang <zzhang@cs.binghamton.edu> To: Matthew Dillon <dillon@apollo.backplane.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: A quick VM question Message-ID: <Pine.SOL.4.21.0112181400110.7875-100000@onyx> In-Reply-To: <200112180855.fBI8tIb68150@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 > <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?Pine.SOL.4.21.0112181400110.7875-100000>