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
734bb68c
Commit
734bb68c
authored
Apr 15, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
463c7e1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
bigfile/tests/tfault.c
bigfile/tests/tfault.c
+3
-3
bigfile/virtmem.c
bigfile/virtmem.c
+5
-7
No files found.
bigfile/tests/tfault.c
View file @
734bb68c
/* Wendelin.bigfile | tests for real faults leading to crash
* Copyright (C) 2014-20
19
Nexedi SA and Contributors.
* Copyright (C) 2014-20
20
Nexedi SA and Contributors.
* Kirill Smelkov <kirr@nexedi.com>
*
* This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -109,7 +109,7 @@ void fault_in_loadblk()
.
file_ops
=
&
faulty_ops
,
};
err
=
fileh_open
(
&
fh
,
&
f
,
ram
);
err
=
fileh_open
(
&
fh
,
&
f
,
ram
,
DONT_MMAP_OVERLAY
);
ok1
(
!
err
);
err
=
fileh_mmap
(
vma
,
&
fh
,
0
,
2
);
...
...
@@ -164,7 +164,7 @@ void fault_in_storeblk()
.
file_ops
=
&
faulty_ops
,
};
err
=
fileh_open
(
&
fh
,
&
f
,
ram
);
err
=
fileh_open
(
&
fh
,
&
f
,
ram
,
DONT_MMAP_OVERLAY
);
ok1
(
!
err
);
err
=
fileh_mmap
(
vma
,
&
fh
,
0
,
2
);
...
...
bigfile/virtmem.c
View file @
734bb68c
...
...
@@ -164,9 +164,8 @@ int fileh_open(BigFileH *fileh, BigFile *file, RAM *ram, FileHOpenFlags flags)
ASSERT
(
fops
->
remmap_blk_read
);
ASSERT
(
fops
->
munmap
);
}
if
(
flags
==
DONT_MMAP_OVERLAY
)
{
if
(
flags
==
DONT_MMAP_OVERLAY
)
ASSERT
(
fops
->
loadblk
);
}
sigsegv_block
(
&
save_sigset
);
virt_lock
();
...
...
@@ -790,9 +789,10 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
/* load block -> pageram memory */
blk
=
page
->
f_pgoffset
;
// NOTE because blksize = pagesize
/* mark page as loading and unlock virtmem before calling loadblk()
/* mark page as loading and unlock virtmem before doing actual load via
* loadblk() or wcfs.
*
*
that call is
potentially slow and external code can take other
*
both calls are
potentially slow and external code can take other
* locks. If that "other locks" are also taken before external code
* calls e.g. fileh_invalidate_page() in different codepath a deadlock
* can happen. (similar to storeblk case) */
...
...
@@ -864,7 +864,7 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
/* (6) page data ready. Mmap it atomically into vma address space, or mprotect
* appropriately if it was already mmaped. */
PageState
newstate
=
PAGE_LOADED
;
// XXX vvv PAGE_LOADED_FOR_WRITE ok?
PageState
newstate
=
PAGE_LOADED
;
if
(
write
||
page
->
state
==
PAGE_DIRTY
||
page
->
state
==
PAGE_LOADED_FOR_WRITE
)
{
newstate
=
PAGE_DIRTY
;
}
...
...
@@ -878,8 +878,6 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
}
page
->
state
=
max
(
page
->
state
,
newstate
);
// XXX overlay: assert !vma->page_ismappedv[blk] XXX not ok? (retrying after virt unlock/lock)
vma_mmap_page
(
vma
,
page
);
/* wcfs: also mmap the page to all wcfs-backed vmas. If we don't, the
* memory on those vmas will read with stale data */
...
...
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