Date: Mon, 28 Jun 1999 02:03:41 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: "Daniel J. O'Connor" <darius@dons.net.au> Cc: Zhihui Zhang <zzhang@cs.binghamton.edu>, freebsd-hackers@FreeBSD.ORG, Ladavac Marino <mladavac@metropolitan.at> Subject: Re: RE: Implementation of mmap() in FreeBSD Message-ID: <199906280903.CAA18676@apollo.backplane.com> References: <XFMail.990628181657.darius@dons.net.au>
next in thread | previous in thread | raw e-mail | index | archive | help
:> Otherwise they wouldn't bother to use mmap and instead would use read() :> and write() :-) : :Hmm.. why (unless you forced mmap to use the address you gave it) would it not :choose the start address to be on a page boundary? : :--- :Daniel O'Connor software and network engineer Because we can't realign the data in the pages without doing a buffer copy. To force mmap() to align the data to the start of the page requires it to allocate memory and copy the in-core disk cache to the new memory. This is extremely wasteful of cpu and memory. The current UNIX mmap implementation is able to simply map the existing in-core disk cache directly to the process - no buffer copying is required at all, and it is extremely memory efficient. Programmers who use mmap() expect it to be as close to optimal as possible. Also, even if we were to realign the data, it would not deal with the end-of-data case. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906280903.CAA18676>