Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 2003 10:48:52 -0500
From:      vivek@CS.Princeton.EDU
To:        Dag-Erling =?iso-8859-1?b?U234cmdyYXY=?= <des@des.no>
Cc:        Kris Kennaway <kris@obsecurity.org>
Subject:   Re: Some mmap observations compared to Linux 2.6/OpenBSD
Message-ID:  <1067183332.3f9bece4c0cf4@webmail.cs.princeton.edu>
In-Reply-To: <xzpk76sc425.fsf@dwp.des.no>
References:  <1066789354.21430.39.camel@boxster.onthenet.com.au> <20031022082953.GA69506@rot13.obsecurity.org> <1066816287.25609.34.camel@boxster.onthenet.com.au> <20031022095754.GA70026@rot13.obsecurity.org> <1066820436.25609.93.camel@boxster.onthenet.com.au> <xzpk76sc425.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
We've been trying to get good SpecWeb99 numbers on FreeBSD using a
user-space server. Our initial results weren't that impressive,
and we traced them to a number of issues, including VM system performance.
We decided to avoid all mmap/mincore operations, and opted to instead
add a flag to sendfile such that we can try sendfile and have it return
an error (instead of blocking) when a page isn't in memory.

So, we were able to adapt the server to avoid all of the VM problems,
but one could imagine someone less eager just coming to the conclusion
that freebsd is slower than linux.

Incidentally, our resulting server gets a SpecWeb99 score of about 800
on a 1GHZ/1GB machine. The highest published score for a comparable
machine is about 600, and that's using the kernel-space Tux server on
Linux. Is anyone interested in merging our changes (mostly to sendfile)
into the kernel? We've just bought a much faster box, and we're trying
to see if we can set the uniprocessor record using only a user-space
server.

Details about what we have so far are at
http://www.cs.princeton.edu/~yruan/debox/

Yaoping Ruan had mentioned this on the list before (and sent a
pointer to the sendfile patches), but didn't seem to get much
response.

-Vivek

Quoting Dag-Erling Smørgrav <des@des.no>:
> Q <q_dolan@yahoo.com.au> writes:
> > Yes, it would appear this is a legacy thing that existed in the original
> > 1994 import of the BSD 4.4 Lite source. Both FreeBSD and NetBSD still
> > use this technique, but OpenBSD changed to using Red-Black trees back in
> > Feb 2002.
> > [...]
> > I am wondering if there is a compelling reason why the technique used by
> > OpenBSD could not be adapted to FreeBSD's VM system.
> 
> Adapting OpenBSD's red-balck patches would require quite a bit of work
> as FreeBSD and OpenBSD have diverged quite a bit in this area.  Though
> it is a good idea to change the list into a tree, I think you'd get
> more mileage by addressing the fundamental problem, which is the lack
> of a free list.  The current code (in both FreeBSD and OpenBSD)
> searches a list or tree of allocated extents, sorted by location,
> looking for a pair that have sufficient space between them for the
> extent you want to create.  We should instead keep track of free
> extents in a structure that makes it easy to locate one of the correct
> size.  We probably need a dual structure, though, because we need to
> keep the free extents sorted both by size (to quickly find what we
> need) and by location (to facilitate aggregation of adjacent extents,
> without which we'd suffer horribly from address space fragmentation).
> 
> I have no idea how much this means for real-life workloads though.
> 
> DES
> -- 
> Dag-Erling Smørgrav - des@des.no
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
> 




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1067183332.3f9bece4c0cf4>