Some mmap observations compared to Linux 2.6/OpenBSD

Q q at onthenet.com.au
Tue Oct 21 19:22:41 PDT 2003


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 at OntheNet.com.au
  __  __/  /   /   __/   /      /          
     /    __  /   _/    /      /         Gold Coast, QLD, Australia
  __/  __/ __/ ____/   /   -  /             Ph: +61 419 729 806
                    _______  /              
                            _\



More information about the freebsd-hackers mailing list