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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
c8e1cb33
Commit
c8e1cb33
authored
Apr 15, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6f4229db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+0
-1
bigfile/virtmem.c
bigfile/virtmem.c
+29
-2
No files found.
bigfile/tests/test_virtmem.c
View file @
c8e1cb33
...
...
@@ -1386,7 +1386,6 @@ void test_file_access_mmapoverlay(void)
xmunmap
(
b0
,
PS
);
xmunmap
(
b2
,
PS
);
// XXX verify notify_munmap was correctly called
/* map vma back - dirty pages should be there _and_ mapped to vma.
* (this differs from !wcfs case which does not mmap dirty pages until access) */
...
...
bigfile/virtmem.c
View file @
c8e1cb33
...
...
@@ -707,16 +707,43 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
page
=
pagemap_get
(
&
fileh
->
pagemap
,
pagen
);
/* wcfs: all dirty pages are mmapped when vma is created.
* thus here, if page is present in pagemap, it can be only either
* thus here,
normally,
if page is present in pagemap, it can be only either
* - a page we just loaded for dirtying, or
* - a page that is in progress of being loaded.
*
* however it can be also a *dirty* page due to simultaneous write
* access from 2 threads:
*
* T1 T2
*
* write pagefault write pagefault
* virt_lock
* page.state = PAGE_LOADING
* virt_unlock
* # start loading the page
* ...
* # loading completed
* virt_lock
* page.state = PAGE_LOADED_FOR_WRITE
* virt_unlock
* return VM_RETRY
* virt_lock
* # sees page.state = PAGE_LOADED_FOR_WRITE
* page.state = PAGE_DIRTY
* virt_unlock
*
* # retrying
* virt_lock
* # sees page.state = PAGE_DIRTY <--
*
*
* ( PAGE_LOADED_FOR_WRITE is used only to verify that in wcfs mode we
* always keep all dirty pages mmapped on fileh_open and so pagefault
* handler must not see a PAGE_LOADED page. )
*/
if
(
fileh
->
mmap_overlay
&&
page
)
ASSERT
(
page
->
state
==
PAGE_LOADED_FOR_WRITE
||
page
->
state
==
PAGE_LOADING
);
ASSERT
(
page
->
state
==
PAGE_LOADED_FOR_WRITE
||
page
->
state
==
PAGE_LOADING
||
page
->
state
==
PAGE_DIRTY
);
/* (4) no page found - allocate new from ram */
while
(
!
page
)
{
...
...
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