Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
980901c0
Commit
980901c0
authored
Feb 21, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f5e5d1bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+16
-8
No files found.
wcfs/client/wcfs.cpp
View file @
980901c0
...
@@ -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 answer
e
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 nec
c
essity 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 sy
n
chronous 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 simultane
sou
ly to us.
// - we need atMu to be not Wlocked, because under atMu.W pinner cannot run simultane
ous
ly 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 ran
g
e.
//
//
// 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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment