Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Matthew Dillon
: [ML] It is possible to handle these cases in VM code, by : trapping on any access to the partial page, and allowing only those : accesses which are withing the originally requested range. Performance : would suck without end, though. : :Well it would only suck for access to that page

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Anonymous
On Mon, 28 Jun 1999, Matthew Dillon wrote: : it is extremely memory efficient. : :I guess you are talking about VMIO buffers where the pages are found and :registered into the buffer header during allocbuf(). When we do I/O on :VMIO buffers using conventional system call method, we

Re: Implementation of mmap() in FreeBSD

1999-06-28 Thread Anonymous
On Mon, 28 Jun 1999 12:54:12 -0700 (PDT) Matthew Dillon [EMAIL PROTECTED] wrote: mmap bypasses the vnode. What you propose will not work because even if the VM object is process-specific, the pages underlying the VM object are not. If several processes are mmap()ing

Re: Implementation of mmap() in FreeBSD

1999-06-28 Thread Anonymous
:Well, if you make a VM object map-entry-specific (not just "process-specific"; :a single process may have multiple mappings of a file!), then the pages :*can't* be shared, because pages are owned by the objects. The only reason :you can share pages is because multiple map entries may reference

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Anonymous
: :By converge, I mean VOP_GETPAGES() and VOP_PUTPAGES() will call VOP_READ() :and VOP_WRITE() just as read() and write() system call. Yes, but what they are doing is mapping the VMIO cache pages into the buffer, so the VOP_READ/VOP_WRITE essentially operates directly on the VMIO

RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Ladavac Marino
: :All these situations seem to me are not handled by FreeBSD mmap() code. I :hope I am wrong. I also wonder why we can not add some information to the No machine's mmap() code handles these situations. It is a side effect of the way MMU's work and the way mmap() was defined -

RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Daniel J. O'Connor
On 28-Jun-99 Ladavac Marino wrote: [ML] It is possible to handle these cases in VM code, by trapping on any access to the partial page, and allowing only those accesses which are withing the originally requested range. Performance would suck without end, though. Well it would only

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Matthew Dillon
: [ML] It is possible to handle these cases in VM code, by : trapping on any access to the partial page, and allowing only those : accesses which are withing the originally requested range. Performance : would suck without end, though. : :Well it would only suck for access to that page

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Matthew Dillon
: 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

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Zhihui Zhang
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

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Matthew Dillon
: it is extremely memory efficient. : :I guess you are talking about VMIO buffers where the pages are found and :registered into the buffer header during allocbuf(). When we do I/O on :VMIO buffers using conventional system call method, we specify UIO_NOCOPY :to instruct the uiomove() do not

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Zhihui Zhang
On Mon, 28 Jun 1999, Matthew Dillon wrote: : it is extremely memory efficient. : :I guess you are talking about VMIO buffers where the pages are found and :registered into the buffer header during allocbuf(). When we do I/O on :VMIO buffers using conventional system call method, we

Re: Implementation of mmap() in FreeBSD

1999-06-28 Thread Jason Thorpe
On Mon, 28 Jun 1999 12:54:12 -0700 (PDT) Matthew Dillon dil...@apollo.backplane.com wrote: mmap bypasses the vnode. What you propose will not work because even if the VM object is process-specific, the pages underlying the VM object are not. If several processes are

Re: Implementation of mmap() in FreeBSD

1999-06-28 Thread Matthew Dillon
:Well, if you make a VM object map-entry-specific (not just process-specific; :a single process may have multiple mappings of a file!), then the pages :*can't* be shared, because pages are owned by the objects. The only reason :you can share pages is because multiple map entries may reference the

Re: RE: Implementation of mmap() in FreeBSD

1999-06-28 Thread Matthew Dillon
: :By converge, I mean VOP_GETPAGES() and VOP_PUTPAGES() will call VOP_READ() :and VOP_WRITE() just as read() and write() system call. Yes, but what they are doing is mapping the VMIO cache pages into the buffer, so the VOP_READ/VOP_WRITE essentially operates directly on the VMIO

Re: Implementation of mmap() in FreeBSD

1999-06-26 Thread Matthew Dillon
This is how mmap() is supposed to work. mmap() may return an area larger then the one you specified due to page-alignment considerations. It is not legal for you to write in an area which is outside the range you specified, but there is no way for the machine to enforce this except