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
a30e0568
Commit
a30e0568
authored
Jul 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X convert everythig to CHECK_MRU
parent
8461fbf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
121 deletions
+42
-121
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+42
-121
No files found.
bigfile/tests/test_virtmem.c
View file @
a30e0568
...
...
@@ -223,7 +223,7 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx)
ok1(!pagemap_get(&(fileh)->pagemap, (pgoffset))); \
} while (0)
/*
check
that ram has MRU pages as specified by pagev */
/*
_check_mru checks
that ram has MRU pages as specified by pagev */
void
_check_mru
(
RAM
*
ram
,
Page
*
mruok
[],
int
nok
,
const
char
*
func
,
const
char
*
file
,
int
line
)
{
Page
**
mruv
=
NULL
,
*
page
;
int
n
=
0
,
i
;
...
...
@@ -235,9 +235,10 @@ void _check_mru(RAM *ram, Page *mruok[], int nok, const char *func, const char *
n
++
;
mruv
=
realloc
(
mruv
,
n
*
sizeof
(
*
mruv
));
mruv
[
n
-
1
]
=
page
;
hlru
=
hlru
->
prev
;
}
if
(
!
(
n
==
nok
&&
memcmp
(
mruv
,
mruok
,
n
)))
{
if
(
!
(
n
==
nok
&&
!
memcmp
(
mruv
,
mruok
,
n
*
sizeof
(
*
mruok
)
)))
{
fprintf
(
stderr
,
"check_mru: different
\n
"
);
fprintf
(
stderr
,
"have: ["
);
for
(
i
=
0
;
i
<
n
;
i
++
)
...
...
@@ -253,7 +254,7 @@ void _check_mru(RAM *ram, Page *mruok[], int nok, const char *func, const char *
free
(
mruv
);
}
/
/ CHECK_MRU(ram, ...pagev)
/
* CHECK_MRU(ram, ...pagev) - check that ram has MRU pages as expected */
#define CHECK_MRU(ram, ...) do { \
Page *__mruok[] = {__VA_ARGS__}; \
_check_mru(ram, __mruok, ARRAY_SIZE(__mruok), __func__, __FILE__, __LINE__); \
...
...
@@ -333,7 +334,7 @@ void test_file_access_synthetic(void)
PSb
=
PS
/
sizeof
(
blk_t
);
/* page size in blk_t units */
/* ensure we are starting from new ram */
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
/*empty*/
);
/* setup id file */
struct
bigfile_ops
x_ops
=
{.
loadblk
=
fileid_loadblk
};
...
...
@@ -370,7 +371,7 @@ void test_file_access_synthetic(void)
CHECK_NOPAGE
(
102
);
CHECK_NOPAGE
(
103
);
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
/*empty*/
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
...
...
@@ -393,9 +394,7 @@ void test_file_access_synthetic(void)
ok1
(
B
(
vma
,
0
*
PSb
+
1
)
==
100
);
ok1
(
B
(
vma
,
0
*
PSb
+
PSb
-
1
)
==
100
);
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page0
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
...
...
@@ -421,10 +420,7 @@ void test_file_access_synthetic(void)
ok1
(
B
(
vma
,
2
*
PSb
+
1
)
==
102
);
ok1
(
B
(
vma
,
2
*
PSb
+
PSb
-
1
)
==
102
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -454,11 +450,7 @@ void test_file_access_synthetic(void)
ok1
(
B
(
vma
,
3
*
PSb
+
1
)
==
103
);
ok1
(
B
(
vma
,
3
*
PSb
+
PSb
-
1
)
==
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page3
,
page2
,
page0
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -488,10 +480,6 @@ void test_file_access_synthetic(void)
ok1
(
B
(
vma
,
3
*
PSb
+
PSb
-
1
)
==
103
);
CHECK_MRU
(
ram
,
page0
,
page3
,
page2
);
/* page0 became MRU */
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
/* page0 became MRU */
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
//CHECK_DIRTY(fh, page0, page2);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
...
...
@@ -530,11 +518,7 @@ void test_file_access_synthetic(void)
ok1
(
B
(
vma
,
2
*
PSb
+
1
)
==
102
);
ok1
(
B
(
vma
,
2
*
PSb
+
PSb
-
1
)
==
102
);
ok1
(
ram
->
lru_list
.
prev
==
&
page1
->
lru
);
ok1
(
page1
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page1
,
page0
,
page2
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -564,10 +548,7 @@ void test_file_access_synthetic(void)
ok1
(
B
(
vma
,
2
*
PSb
+
PSb
-
1
)
==
102
);
/* page[3] went away */
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page0
,
page2
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -585,10 +566,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
0
);
CHECK_NOPAGE
(
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page0
,
page2
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -627,10 +605,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
0
);
CHECK_NOPAGE
(
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page0
,
page2
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -650,10 +625,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
CHECK_NOPAGE
(
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -673,10 +645,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_EMPTY
,
0
);
CHECK_NOPAGE
(
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
...
...
@@ -711,11 +680,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_EMPTY
,
0
);
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
1
);
ok1
(
ram
->
lru_list
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page3
,
page2
,
page0
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
...
...
@@ -738,11 +703,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
0
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -788,11 +749,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_LOADED
,
1
);
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
0
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
diag
(
"writeout (store+mark)"
);
...
...
@@ -814,11 +771,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_LOADED
,
1
);
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
0
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
/* invalidation */
...
...
@@ -837,11 +790,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
0
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -859,11 +808,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
CHECK_PAGE
(
page3
,
103
,
PAGE_EMPTY
,
0
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -881,11 +826,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_EMPTY
,
0
);
CHECK_PAGE
(
page3
,
103
,
PAGE_EMPTY
,
0
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
...
@@ -902,11 +843,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_EMPTY
,
0
);
CHECK_PAGE
(
page3
,
103
,
PAGE_EMPTY
,
0
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
/* read page[3] back */
...
...
@@ -922,11 +859,7 @@ void test_file_access_synthetic(void)
CHECK_PAGE
(
page2
,
102
,
PAGE_EMPTY
,
0
);
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
1
);
ok1
(
ram
->
lru_list
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page3
,
page2
,
page0
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
...
...
@@ -936,15 +869,15 @@ void test_file_access_synthetic(void)
vma_unmap
(
vma
);
/* ensure pages stay in ram lru with expected state */
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
state
==
PAGE_DIRTY
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
state
==
PAGE_DIRTY
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
state
==
PAGE_LOADED
);
ok1
(
page3
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
,
page3
);
ok1
(
page2
->
state
==
PAGE_DIRTY
);
ok1
(
page0
->
state
==
PAGE_DIRTY
);
ok1
(
page3
->
state
==
PAGE_LOADED
);
fileh_close
(
fh
);
/* pages associated with fileh should go away after fileh_close() */
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
/*empty*/
);
/* free resources & restore SIGSEGV handler */
...
...
@@ -984,7 +917,7 @@ void test_file_access_pagefault()
PSb
=
PS
/
sizeof
(
blk_t
);
/* page size in blk_t units */
/* ensure we are starting from new ram */
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
/*empty*/
);
/* setup id file */
BigFileIdentity
fileid
=
{
...
...
@@ -1009,7 +942,7 @@ void test_file_access_pagefault()
ok1
(
!
M
(
vma
,
2
));
CHECK_NOPAGE
(
102
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
,
/*empty*/
);
/* read page[0] */
ok1
(
B
(
vma
,
0
*
PSb
)
==
100
);
...
...
@@ -1020,8 +953,7 @@ void test_file_access_pagefault()
ok1
(
!
M
(
vma
,
2
));
CHECK_NOPAGE
(
102
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page0
);
/* write to page[2] */
...
...
@@ -1033,9 +965,7 @@ void test_file_access_pagefault()
ok1
(
M
(
vma
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
,
page0
);
/* read page[3] */
...
...
@@ -1047,10 +977,7 @@ void test_file_access_pagefault()
ok1
(
M
(
vma
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
ok1
(
M
(
vma
,
3
));
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
1
);
ok1
(
ram
->
lru_list
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page3
,
page2
,
page0
);
/* write to page[0] */
...
...
@@ -1061,10 +988,7 @@ void test_file_access_pagefault()
ok1
(
M
(
vma
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
ok1
(
M
(
vma
,
3
));
CHECK_PAGE
(
page3
,
103
,
PAGE_LOADED
,
1
);
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
/* page0 became MRU */
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page0
,
page3
,
page2
);
/* page0 became MRU */
/* unmap vma */
...
...
@@ -1234,7 +1158,7 @@ void test_file_access_mmapbase(void)
PSb
=
PS
/
sizeof
(
blk_t
);
/* page size in blk_t units */
/* ensure we are starting from new ram */
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
/*empty*/
);
/* setup mmaped file */
char
path
[]
=
"/tmp/bigfile_mmap.XXXXXX"
;
...
...
@@ -1286,7 +1210,7 @@ void test_file_access_mmapbase(void)
ok1
(
!
M
(
vma
,
2
));
CHECK_NOPAGE
(
102
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
/*empty*/
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
/* read page[0] - served from base mmap and no RAM page is loaded */
...
...
@@ -1299,7 +1223,7 @@ void test_file_access_mmapbase(void)
ok1
(
!
M
(
vma
,
2
));
CHECK_NOPAGE
(
102
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
list_empty
(
&
ram
->
lru_list
)
);
CHECK_MRU
(
ram
/*empty*/
);
ok1
(
list_empty
(
&
fh
->
dirty_pages
));
/* write to page[2] - page2 is copy-on-write created in RAM */
...
...
@@ -1317,8 +1241,6 @@ void test_file_access_mmapbase(void)
CHECK_MRU
(
ram
,
page2
);
//CHECK_DIRTY(fh, page2);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
/* read page[3] - served from base mmap */
ok1
(
B
(
vma
,
3
*
PSb
+
0
)
==
103
);
...
...
@@ -1330,8 +1252,8 @@ void test_file_access_mmapbase(void)
ok1
(
M
(
vma
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
1
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page2
);
// XXX CHECK_DIRTY
/* write to page[0] - page COW'ed into RAM */
B
(
vma
,
0
*
PSb
)
=
10
;
...
...
@@ -1346,9 +1268,8 @@ void test_file_access_mmapbase(void)
ok1
(
B
(
vma
,
0
*
PSb
+
1
)
==
100
);
ok1
(
B
(
vma
,
0
*
PSb
+
PSb
-
1
)
==
100
);
ok1
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
CHECK_MRU
(
ram
,
page0
,
page2
);
// XXX dirty
}
...
...
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