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
675e6415
Commit
675e6415
authored
Jul 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a0275a3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+18
-1
No files found.
bigfile/tests/test_virtmem.c
View file @
675e6415
...
@@ -223,6 +223,19 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx)
...
@@ -223,6 +223,19 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx)
ok1(!pagemap_get(&(fileh)->pagemap, (pgoffset))); \
ok1(!pagemap_get(&(fileh)->pagemap, (pgoffset))); \
} while (0)
} while (0)
/* check that ram has MRU pages as specified by pagev */
void
_check_mru
(
RAM
*
ram
,
Page
*
pagev
[],
int
pagec
)
{
// XXX
}
// XXX + fail with line
// CHECK_MRU(ram, ...pagev)
#define CHECK_MRU(ram, ...) do { \
Page *__pagev[] = {__VA_ARGS__}; \
_check_mru(ram, __pagev, ARRAY_SIZE(__pagev)); \
} while(0)
/* vma_on_pagefault() assumes virtmem_lock is taken by caller and can ask it to
/* vma_on_pagefault() assumes virtmem_lock is taken by caller and can ask it to
* retry. Handle fault to the end, like on_pagefault() does. */
* retry. Handle fault to the end, like on_pagefault() does. */
...
@@ -450,11 +463,13 @@ void test_file_access_synthetic(void)
...
@@ -450,11 +463,13 @@ void test_file_access_synthetic(void)
ok1
(
B
(
vma
,
3
*
PSb
+
1
)
==
103
);
ok1
(
B
(
vma
,
3
*
PSb
+
1
)
==
103
);
ok1
(
B
(
vma
,
3
*
PSb
+
PSb
-
1
)
==
103
);
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
(
ram
->
lru_list
.
prev
==
&
page0
->
lru
);
/* page0 became MRU */
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page0
->
lru
.
prev
==
&
page3
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page3
->
lru
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
//CHECK_DIRTY(fh, page0, page2);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
fh
->
dirty_pages
.
prev
==
&
page0
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page0
->
in_dirty
.
prev
==
&
page2
->
in_dirty
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
ok1
(
page2
->
in_dirty
.
prev
==
&
fh
->
dirty_pages
);
...
@@ -1276,6 +1291,8 @@ void test_file_access_mmapbase(void)
...
@@ -1276,6 +1291,8 @@ void test_file_access_mmapbase(void)
ok1
(
B
(
vma
,
2
*
PSb
+
1
)
==
102
);
ok1
(
B
(
vma
,
2
*
PSb
+
1
)
==
102
);
ok1
(
B
(
vma
,
2
*
PSb
+
PSb
-
1
)
==
102
);
ok1
(
B
(
vma
,
2
*
PSb
+
PSb
-
1
)
==
102
);
CHECK_MRU
(
ram
,
page2
);
//CHECK_DIRTY(fh, page2);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
ram
->
lru_list
.
prev
==
&
page2
->
lru
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
ok1
(
page2
->
lru
.
prev
==
&
ram
->
lru_list
);
...
@@ -1317,7 +1334,7 @@ int main()
...
@@ -1317,7 +1334,7 @@ int main()
{
{
tap_fail_callback
=
abort
;
// XXX to catch failure immediately
tap_fail_callback
=
abort
;
// XXX to catch failure immediately
if
(
0
)
{
if
(
1
)
{
test_vmamap
();
test_vmamap
();
test_file_access_synthetic
();
test_file_access_synthetic
();
test_file_access_pagefault
();
test_file_access_pagefault
();
...
...
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