Commit 980901c0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f5e5d1bc
...@@ -22,7 +22,15 @@ ...@@ -22,7 +22,15 @@
// Wcfs client organization // Wcfs client organization
// //
// - need to maintain pinner map registry // Wcfs client provides to its users isolated bigfile views backed by data on
// WCFS filesystem. In the absence of Isolation property, wcfs client would
// reduce to just directly using OS-level file wcfs/head/f for a bigfile f. On
// the other hand there is a simple, but inefficient, way to support isolation:
// for @at database view of bigfile f - directly use OS-level file wcfs/@at/f.
//
//
//
// - need to maintain pinner map registry XXX no need
// //
// [blk< +len) -> vma ↓blk // [blk< +len) -> vma ↓blk
// #blk -> []vma covering it // #blk -> []vma covering it
...@@ -55,7 +63,7 @@ ...@@ -55,7 +63,7 @@
// synchronously from other threads via messages coming through wcfs server. // synchronously from other threads via messages coming through wcfs server.
// For example Conn.resync sends watch request to wcfs and waits for the // For example Conn.resync sends watch request to wcfs and waits for the
// answer. Wcfs server, in turn, might send corresponding pin messages to the // answer. Wcfs server, in turn, might send corresponding pin messages to the
// pinner and _wait_ for the answere before answering to resync: // pinner and _wait_ for the answer before answering to resync:
// //
// - - - - - - // - - - - - -
// | .···|·····. ----> = request // | .···|·····. ----> = request
...@@ -66,8 +74,8 @@ ...@@ -66,8 +74,8 @@
// - - - - - - // - - - - - -
// client process // client process
// //
// This creates the neccessity to use RWMutex for locks that pinner and other // This creates the necessity to use RWMutex for locks that pinner and other
// parts of the code could be using at the same time in sychronous mode similar // parts of the code could be using at the same time in synchronous mode similar
// to the above. This locks are: // to the above. This locks are:
// //
// - Conn.atMu // - Conn.atMu
...@@ -497,7 +505,7 @@ error _FileH::close() { ...@@ -497,7 +505,7 @@ error _FileH::close() {
xerr::Contextf E("%s: close f<%s>", v(wconn), v(fileh.foid)); xerr::Contextf E("%s: close f<%s>", v(wconn), v(fileh.foid));
// XXX change all fileh.mmaps to cause EFAULT on any access after fileh.close // XXX change all fileh.mmaps to cause EFAULT on any access after fileh.close
// XXX "watch foid -" -> wconn.wlink (stop watchingthe file) // XXX "watch foid -" -> wconn.wlink (stop watching the file)
// remove fileh from wconn._filehTab // remove fileh from wconn._filehTab
// fileh.close can be called several times and after first call another // fileh.close can be called several times and after first call another
...@@ -609,10 +617,10 @@ error _Conn::resync(zodb::Tid at) { ...@@ -609,10 +617,10 @@ error _Conn::resync(zodb::Tid at) {
} }
// atomically downgrade atMu.W to atMu.R before issuing watch updates to wcfs. // atomically downgrade atMu.W to atMu.R before issuing watch updates to wcfs.
// - we need atMu to be not Wlocked, because under atMu.W pinner cannot run simultanesouly to us. // - we need atMu to be not Wlocked, because under atMu.W pinner cannot run simultaneously to us.
// - we need to hold atMu.R to avoid race wrt e.g. other resync which changes at. // - we need to hold atMu.R to avoid race wrt e.g. other resync which changes at.
// - we cannot just do regular `atMu.Unlock + atMu.RLock()` because then // - we cannot just do regular `atMu.Unlock + atMu.RLock()` because then
// there is a race window inbetween Unlock and RLock where wconn.at can be changed. // there is a race window in between Unlock and RLock where wconn.at can be changed.
// XXX also deadlock, because it will become wconn._mu.lock + wconn._atMu lock // XXX also deadlock, because it will become wconn._mu.lock + wconn._atMu lock
// //
// Now other calls, e.g. Conn.open, can be running simultaneously to us, // Now other calls, e.g. Conn.open, can be running simultaneously to us,
...@@ -915,7 +923,7 @@ static error mmap_into_ro(void *addr, size_t size, os::File f, off_t offset) { ...@@ -915,7 +923,7 @@ static error mmap_into_ro(void *addr, size_t size, os::File f, off_t offset) {
// _assertVMAOk() verifies that mmap and vma are related to each other and cover // _assertVMAOk() verifies that mmap and vma are related to each other and cover
// exactly the same virtual memory rane. // exactly the same virtual memory range.
// //
// It panics if mmap and vma do not exactly relate to each other or cover // It panics if mmap and vma do not exactly relate to each other or cover
// different virtual memory range. // different virtual memory range.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment