Some mmap observations compared to Linux 2.6/OpenBSD

John-Mark Gurney gurney_j at
Sun Oct 26 09:57:32 PST 2003

vivek at CS.Princeton.EDU wrote this message on Sun, Oct 26, 2003 at 10:48 -0500:
> 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.

I was thinking about this myself, but how do you prevent spinning on
the sendfile waiting for the page to become available?  You have the
send space to wait for on the socket, but there is no equivalent kqueue
event to wait for when a page becomes available.  Do you simply always
spin on sendfile since the socket keeps returning available for writing?

I have a similar web server design that I wrote at the end of last
year, and your paper brought to light to problems of sendfile, so I have
been thinking of switching to async io, since there you can get
completion status when the io completes.

  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

More information about the freebsd-hackers mailing list