From owner-freebsd-hackers Tue Dec 18 0:55:22 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id F2CB637B405 for ; Tue, 18 Dec 2001 00:55:19 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id fBI8tIb68150; Tue, 18 Dec 2001 00:55:18 -0800 (PST) (envelope-from dillon) Date: Tue, 18 Dec 2001 00:55:18 -0800 (PST) From: Matthew Dillon Message-Id: <200112180855.fBI8tIb68150@apollo.backplane.com> To: Zhihui Zhang Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: A quick VM question References: 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 :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