* Re: VM support for transaction processing [not found] <Pine.LNX.3.96.980424174134.891C-100000@carissimi.coda.cs.cmu.edu> @ 1998-04-25 15:33 ` Benjamin C.R. LaHaise 1998-06-19 0:45 ` Eric W. Biederman 0 siblings, 1 reply; 2+ messages in thread From: Benjamin C.R. LaHaise @ 1998-04-25 15:33 UTC (permalink / raw) To: Peter J. Braam Cc: torvalds, linux-kernel, linux-coda, Michael Callahan, linux-mm On Fri, 24 Apr 1998, Peter J. Braam wrote: ... > Is there a method to say to the kernel: > > A) this page is now starting to diverge from its disk copy, start > treating it as VM. > B) we have now synced this page, forget about VM, it's backed by the > file again if you need to swap it out. > > If not can we do something about that easily? ... There are two answers to the question depending on where you're asking to get this behaviour: if you want to do this from a user space process, mmap w/MAP_PRIVATE and msync w/MS_INVALIDATE will do what you want. However, if you're looking to do this within the kernel to support transaction processing on memory mappings, life is a bit more difficult as MAP_SHARED mappings allow user space processes to write into a page even while it is being updated on disk (okay under most circumstances as a future update is guarenteed). That behavior could be changed easily enough by walking the i_mmap ring and invalidating any pages before actually beginning the write. Hmmm, looking at filemap_swapin: shouldn't it wait for the page to become unlocked before allowing the user to make use of the mapping? Should the write semantics of mmapings be cleaned up before 2.2? I'm thinking of a small set of changes: write protect pages when beginning to write them out to disk (to avoid the performance hit on the normal case, have a hint bit in page->flags if the page has any writable mappings), and make filemap_swapin wait for the page to become !Locked && Uptodate. -ben ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: VM support for transaction processing 1998-04-25 15:33 ` VM support for transaction processing Benjamin C.R. LaHaise @ 1998-06-19 0:45 ` Eric W. Biederman 0 siblings, 0 replies; 2+ messages in thread From: Eric W. Biederman @ 1998-06-19 0:45 UTC (permalink / raw) To: Benjamin C.R. LaHaise; +Cc: linux-mm >>>>> "BL" == Benjamin C R LaHaise <blah@kvack.org> writes: BL> On Fri, 24 Apr 1998, Peter J. Braam wrote: BL> ... BL> Hmmm, looking at filemap_swapin: shouldn't it wait for the page to become BL> unlocked before allowing the user to make use of the mapping? A) Yes B) It doesn't matter because nothing currently in the kernel writes pages directly out from the page cache yet... BL> Should the BL> write semantics of mmapings be cleaned up before 2.2? I'm thinking of a BL> small set of changes: write protect pages when beginning to write them out BL> to disk (to avoid the performance hit on the normal case, have a hint bit BL> in page->flags if the page has any writable mappings), and make BL> filemap_swapin wait for the page to become !Locked && Uptodate. Since the page is being written the page is garanteed to be Uptodate. Since we currently don't write things through the page cache we don't need to worry about it being locked. For really implementing writes through the page cache I have to tackle all of these issues. The write protect sounds good, but you need to watch for other code that will notice it is allowed to be a writeable mapping and convert it. It also has the problem of when to decrement the page count, which is primarily what the current mechanism gives us. So changing it is tricky. Eric ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-06-19 0:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <Pine.LNX.3.96.980424174134.891C-100000@carissimi.coda.cs.cmu.edu>
1998-04-25 15:33 ` VM support for transaction processing Benjamin C.R. LaHaise
1998-06-19 0:45 ` Eric W. Biederman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox