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
fe89563b
Commit
fe89563b
authored
Feb 21, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
862c2cad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+17
-16
No files found.
wcfs/client/wcfs.cpp
View file @
fe89563b
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
// Wcfs client implements pins handling in so-called "pinner" thread(+). The
// Wcfs client implements pins handling in so-called "pinner" thread(+). The
// pinner thread receives pin requests from wcfs server via watchlink handle
// pinner thread receives pin requests from wcfs server via watchlink handle
// opened through wcfs/head/watch. For every pin request the pinner finds
// opened through wcfs/head/watch. For every pin request the pinner finds
// corresponding
mappings and injects wcfs/@revX/f parts into the m
appings
// corresponding
Mappings and injects wcfs/@revX/f parts into the M
appings
// appropriately.
// appropriately.
//
//
// The same watchlink handle is used to send client-originated requests to wcfs
// The same watchlink handle is used to send client-originated requests to wcfs
...
@@ -55,9 +55,9 @@
...
@@ -55,9 +55,9 @@
// points like Conn.open, Conn.resync and FileH.close.
// points like Conn.open, Conn.resync and FileH.close.
//
//
// Every FileH maintains fileh._pinned {} with currently pinned blk -> rev. The
// Every FileH maintains fileh._pinned {} with currently pinned blk -> rev. The
// dict is updated by pinner driven by pin messages, and is used
used when
// dict is updated by pinner driven by pin messages, and is used
when either
//
either new fileh Mapping is created (FileH.mmap) or refreshed due to request
//
new fileh Mapping is created (FileH.mmap) or refreshed due to request from
//
from
virtmem (Mapping.remmap_blk, see below).
// virtmem (Mapping.remmap_blk, see below).
//
//
// In wendelin.core a bigfile has semantic that it is infinite in size and
// In wendelin.core a bigfile has semantic that it is infinite in size and
// reads as all zeros beyond region initialized with data. Memory-mapping of
// reads as all zeros beyond region initialized with data. Memory-mapping of
...
@@ -73,21 +73,22 @@
...
@@ -73,21 +73,22 @@
//
//
// Integration with wendelin.core virtmem layer
// Integration with wendelin.core virtmem layer
//
//
// Wcfs integrates with virtmem layer to support virtmem to handle dirtying
// Wcfs client integrates with virtmem layer to support virtmem to handle
// pages of read-only base-layer that wcfs client provides via isolated
// dirtying pages of read-only base-layer that wcfs client provides via
// Mapping. For wcfs-backed bigfiles every VMA is interlinked with Mapping:
// isolated Mapping. For wcfs-backed bigfiles every VMA is interlinked with
// Mapping:
//
//
// VMA -> BigFileH -> ZBigFile
--.
// VMA -> BigFileH -> ZBigFile
-----> Z
// ↑↓
ZODB
// ↑↓
O
// Mapping -> FileH -> wcfs server --
'
// Mapping -> FileH -> wcfs server --
> DB
//
//
// When a page is write-accessed, virtmem mmaps in a page of RAM in place of
// When a page is write-accessed, virtmem mmaps in a page of RAM in place of
// accessed virtual memory, copies base-layer content provided by Mapping into
// accessed virtual memory, copies base-layer content provided by Mapping into
// there, and marks that page as read-write
accessed
.
// there, and marks that page as read-write.
//
//
// Upon receiving pin message, the pinner consults virtmem, whether
// Upon receiving pin message, the pinner consults virtmem, whether
// corresponding page was already dirtied in virtmem's BigFileH, and if it was,
// corresponding page was already dirtied in virtmem's BigFileH, and if it was,
// the pinner does not remmap
virtual memory
to wcfs/@revX/f and just leaves
// the pinner does not remmap
Mapping part
to wcfs/@revX/f and just leaves
// dirty page in its place, remembering pin information in fileh._pinned.
// dirty page in its place, remembering pin information in fileh._pinned.
//
//
// Once dirty pages are no longer needed (either after discard/abort or
// Once dirty pages are no longer needed (either after discard/abort or
...
@@ -97,9 +98,10 @@
...
@@ -97,9 +98,10 @@
// The scheme outlined above does not need to split Mapping upon dirtying an
// The scheme outlined above does not need to split Mapping upon dirtying an
// inner page.
// inner page.
//
//
// See bigfile_ops (wendelin/bigfile/file.h) for interface related to
// See bigfile_ops (wendelin/bigfile/file.h) for virtmem interface related to
// base-layer overlaying from virtmem point of view. For wcfs, this interface
// base-layer overlaying that explains the process from virtmem point of view.
// is provided by small wcfs client wrapper in bigfile/file_zodb.cpp .
// For wcfs this interface is provided by small wcfs client wrapper in
// bigfile/file_zodb.cpp.
//
//
// --------
// --------
//
//
...
@@ -107,7 +109,6 @@
...
@@ -107,7 +109,6 @@
// (+) currently, for simplicity, there is one pinner for each connection. In
// (+) currently, for simplicity, there is one pinner for each connection. In
// the future, for efficiency, it might be reworked to be one pinner thread
// the future, for efficiency, it might be reworked to be one pinner thread
// that serves all connections simultaneously.
// that serves all connections simultaneously.
// XXX (wcfs client-level file handle - see package overview) ?
// XXX locking -> explain atMu + slaves and refer to "Locking" in wcfs.go
// XXX locking -> explain atMu + slaves and refer to "Locking" in wcfs.go
...
...
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