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
25f07b48
Commit
25f07b48
authored
Apr 14, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7bdbe18e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+19
-9
bigfile/virtmem.c
bigfile/virtmem.c
+1
-1
No files found.
bigfile/tests/test_virtmem.c
View file @
25f07b48
...
...
@@ -1125,9 +1125,9 @@ void test_pagefault_savestate()
struct
BigFileMMap
{
BigFile
;
int
fd
;
/* fd of file to mmap */
int
nstoreblk
;
/* number of times storeblk
called
*/
// XXX nremmap + check
int
nmunmap
;
/* ----//---- munmap
called
*/
int
nstoreblk
;
/* number of times storeblk
called
*/
int
nremmapblk
;
/* ----//---- remmap_blk_read called */
int
nmunmap
;
/* ----//---- munmap
called
*/
};
typedef
struct
BigFileMMap
BigFileMMap
;
...
...
@@ -1183,6 +1183,7 @@ int mmapfile_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) {
uintptr_t
addr
=
vma
->
addr_start
+
pgoff_invma
*
f
->
blksize
;
void
*
mapped
;
f
->
nremmapblk
++
;
mapped
=
mmap
((
void
*
)
addr
,
1
*
f
->
blksize
,
PROT_READ
,
MAP_SHARED
|
MAP_FIXED
,
f
->
fd
,
blk
*
f
->
blksize
);
if
(
mapped
==
MAP_FAILED
)
return
-
1
;
...
...
@@ -1250,6 +1251,7 @@ void test_file_access_mmapoverlay(void)
.
file_ops
=
&
mmapfile_ops
,
.
fd
=
fd
,
.
nstoreblk
=
0
,
.
nremmapblk
=
0
,
.
nmunmap
=
0
,
};
...
...
@@ -1468,7 +1470,9 @@ void test_file_access_mmapoverlay(void)
/* discard - changes should go away */
diag
(
"discard"
);
ok1
(
file
.
nremmapblk
==
0
);
fileh_dirty_discard
(
fh
);
ok1
(
file
.
nremmapblk
==
3
);
/* 3 previously dirty pages remmaped from base layer */
CHECK_NOPAGE
(
100
);
...
...
@@ -1532,10 +1536,12 @@ void test_file_access_mmapoverlay(void)
}
diag
(
"writeout (store)"
);
file
.
nstoreblk
=
0
;
file
.
nremmapblk
=
0
;
mkdirty2
(
10
);
file
.
nstoreblk
=
0
;
ok1
(
!
fileh_dirty_writeout
(
fh
,
WRITEOUT_STORE
));
ok1
(
file
.
nstoreblk
==
2
);
ok1
(
file
.
nstoreblk
==
2
);
ok1
(
file
.
nremmapblk
==
0
);
ok1
(
M
(
vma
,
0
));
CHECK_PAGE
(
page0
,
100
,
PAGE_DIRTY
,
1
);
ok1
(
!
M
(
vma
,
1
));
CHECK_NOPAGE
(
101
);
...
...
@@ -1563,9 +1569,11 @@ void test_file_access_mmapoverlay(void)
xmunmap
(
b2
,
PS
);
diag
(
"writeout (mark)"
);
file
.
nstoreblk
=
0
;
file
.
nstoreblk
=
0
;
file
.
nremmapblk
=
0
;
ok1
(
!
fileh_dirty_writeout
(
fh
,
WRITEOUT_MARKSTORED
));
ok1
(
file
.
nstoreblk
==
0
);
ok1
(
file
.
nstoreblk
==
0
);
ok1
(
file
.
nremmapblk
==
1
);
/* only 1 (not 2) page was mmaped */
ok1
(
!
M
(
vma
,
0
));
CHECK_NOPAGE
(
100
);
ok1
(
!
M
(
vma
,
1
));
CHECK_NOPAGE
(
101
);
...
...
@@ -1594,9 +1602,11 @@ void test_file_access_mmapoverlay(void)
diag
(
"writeout (store+mark)"
);
mkdirty2
(
1000
);
file
.
nstoreblk
=
0
;
file
.
nstoreblk
=
0
;
file
.
nremmapblk
=
0
;
ok1
(
!
fileh_dirty_writeout
(
fh
,
WRITEOUT_STORE
|
WRITEOUT_MARKSTORED
));
ok1
(
file
.
nstoreblk
==
2
);
ok1
(
file
.
nstoreblk
==
2
);
ok1
(
file
.
nremmapblk
==
1
);
/* only 1 (not 2) page was mmaped */
ok1
(
!
M
(
vma
,
0
));
CHECK_NOPAGE
(
100
);
ok1
(
!
M
(
vma
,
1
));
CHECK_NOPAGE
(
101
);
...
...
bigfile/virtmem.c
View file @
25f07b48
...
...
@@ -446,7 +446,7 @@ int fileh_dirty_writeout(BigFileH *fileh, enum WriteoutFlags flags)
/* 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
* NOTE for transaction
al
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
...
...
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