From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 21 19:22:41 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73FAB16A4B3 for ; Tue, 21 Oct 2003 19:22:41 -0700 (PDT) Received: from ram.onthenet.com.au (ram.OntheNet.com.au [203.13.70.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDE1143FA3 for ; Tue, 21 Oct 2003 19:22:39 -0700 (PDT) (envelope-from q@onthenet.com.au) Received: from [172.22.1.10] (boxster.staff.onthenet.com.au [172.22.1.10]) (authenticated bits=0)h9M2MbI7066960 for ; Wed, 22 Oct 2003 12:22:38 +1000 (EST) (envelope-from q@onthenet.com.au) From: Q To: freebsd-hackers@freebsd.org Message-Id: <1066789354.21430.39.camel@boxster.onthenet.com.au> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 22 Oct 2003 12:22:35 +1000 X-RAVMilter-Version: 8.4.2(snapshot 20021212) (ram.onthenet.com.au) Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Some mmap observations compared to Linux 2.6/OpenBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2003 02:22:41 -0000 As an effort to get more acquainted with the FreeBSD kernel, I have been looking through how mmap works. I don't yet understand how it all fits together, or of the exact implications things may have in the wild, but I have noticed under some synthetic conditions, ie. mmaping small non-contiguous pages of a file, mmap allocation scales much more poorly on FreeBSD than on OpenBSD and Linux 2.6. After investigating this further I have observed that vm_map_findspace() traverses a linked list to find the next region (O(n) cost), whereas OpenBSD and Linux 2.6 both use Red-Black trees for the same purpose (O(log n) cost). Profiling the FreeBSD kernel appears to confirm this. Can someone comment on whether this is something that has been done intentionally, or avoided in favour of some other yet to be implemented solution? Or is it still on someones todo list. -- Seeya...Q -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- _____ / Quinton Dolan - q@OntheNet.com.au __ __/ / / __/ / / / __ / _/ / / Gold Coast, QLD, Australia __/ __/ __/ ____/ / - / Ph: +61 419 729 806 _______ / _\