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
4a20a573
Commit
4a20a573
authored
Jul 11, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X Settled on what should happen after writeout for wcfs case
parent
034b05b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
6 deletions
+44
-6
bigfile/virtmem.c
bigfile/virtmem.c
+39
-4
include/wendelin/bigfile/virtmem.h
include/wendelin/bigfile/virtmem.h
+5
-2
No files found.
bigfile/virtmem.c
View file @
4a20a573
...
...
@@ -425,17 +425,52 @@ int fileh_dirty_writeout(BigFileH *fileh, enum WriteoutFlags flags)
goto
out
;
}
/* page.state -> PAGE_LOADED and correct mappings RW -> R */
// XXX wcfs: just remmap base file? (but it does not yet have stored changes)
// XXX -> vma_remove_readonly_overlay()?
/* wcfs: remmap RW pages to base layer
* !wcfs: page.state -> PAGE_LOADED and correct mappings RW -> R
*
* NOTE for transaction storage (ZODB and ZBigFile) storeblk creates
* new transaction on database side, but does not update current DB
* connection to view that transaction. Thus if loadblk will be loaded
* with not-yet-resynced DB connection, it will return old - not stored
* - data. For !wcfs case this is partly mitigated by the fact that
* stored pages are kept as PAGE_LOADED in ram, but it cannot be
* relied as ram_reclaim can drop those pages and read access to them
* will trigger loadblk from database which will return old data.
* For wcfs case remapping to base layer will always return old data
* until wcfs mapping is updated to view database at newer state.
*
* In general it is a bug to access data pages in between transactions,
* so we accept those corner case difference in between wcfs and !wcfs.
*/
if
(
flags
&
WRITEOUT_MARKSTORED
)
{
page
->
state
=
PAGE_LOADED
;
list_del_init
(
&
page
->
in_dirty
);
list_for_each
(
hmmap
,
&
fileh
->
mmaps
)
{
VMA
*
vma
=
list_entry
(
hmmap
,
typeof
(
*
vma
),
same_fileh
);
vma_page_ensure_notmappedrw
(
vma
,
page
);
if
(
vma
->
mmap_overlay
)
{
/* wcfs: RW -> base layer */
vma_page_ensure_unmapped
(
vma
,
page
);
}
else
{
/* !wcfs: RW -> R*/
vma_page_ensure_notmappedrw
(
vma
,
page
);
}
}
// XXX just relying on page->refcnt==0 is wrong - for !wcfs case
// when there are no mappings it will unnecessarily drop fileh cache.
// -> move mmap_overlay from vma to fileh and check:
// if (fileh->mmap_overlay) {
// ASSERT(page->refcnt == 0);
// page_drop(page);
// }
#if 0
/* if noone is using the page (ex all vmas use base layer) - drop
* it completely without unnecessarily growing RSS and relying on reclaim. */
if (page->refcnt == 0) {
}
#endif
}
}
...
...
include/wendelin/bigfile/virtmem.h
View file @
4a20a573
...
...
@@ -29,6 +29,8 @@
* Read access to mapped pages cause their on-demand loading, and write access
* marks modified pages as dirty. Dirty pages then can be on request either
* written out back to file or discarded.
*
* XXX update for wcfs.
*/
#include <stdint.h>
...
...
@@ -205,8 +207,9 @@ enum WriteoutFlags {
/* mark dirty pages as stored to file ok
*
* pages state becomes PAGE_LOADED and all mmaps are updated to map pages as
* R/O to track further writes.
* wcfs: all mmaps are updated to map read-only to base layer.
* !wcfs: pages state becomes PAGE_LOADED and all mmaps are updated to map
* pages as R/O to track further writes.
*/
WRITEOUT_MARKSTORED
=
1
<<
1
,
};
...
...
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