From owner-freebsd-hackers Wed May 1 10:25:58 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from warez.scriptkiddie.org (uswest-dsl-142-38.cortland.com [209.162.142.38]) by hub.freebsd.org (Postfix) with ESMTP id 4AF5137B419 for ; Wed, 1 May 2002 10:25:53 -0700 (PDT) Received: from [192.168.69.11] (unknown [192.168.69.11]) by warez.scriptkiddie.org (Postfix) with ESMTP id 4469E62D1A; Wed, 1 May 2002 10:25:49 -0700 (PDT) Date: Wed, 1 May 2002 10:28:15 -0700 (PDT) From: Lamont Granquist To: David Schultz Cc: Rohit Grover , Subject: Re: VM Question (was Re: larger kernel virtual address space) In-Reply-To: <20020501002336.A14305@HAL9000.wox.org> Message-ID: <20020501102349.J6199-100000@coredump.scriptkiddie.org> 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 On Wed, 1 May 2002, David Schultz wrote: > Thus spake Lamont Granquist : > > Does the FreeBSD VM system do O(1) or O(N) searches for gaps in a > > processes virtual memory space? > > I'm not a VM guru, but if I'm reading vm_map.c right, it's O(n) > w.r.t. the number of map entries. But since map entries are merged > when possible, I would expect the cost to stay fairly low. I know of one app running on Linux/x86 which spends about 40% of its kernel time in get_unmapped_pages() (the Linux equivalent). Trying to mmap() bits and pieces of 20GB worth of data into a 4GB VM space tends to lead to a lot of fragmentation. Be interesting to see if merging would help, but I'd suggest an O(1) algorithm for this. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message