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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
8a00147e
Commit
8a00147e
authored
Jul 11, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4bca517a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
bigfile/virtmem.c
bigfile/virtmem.c
+13
-4
include/wendelin/bigfile/file.h
include/wendelin/bigfile/file.h
+11
-4
include/wendelin/bigfile/ram.h
include/wendelin/bigfile/ram.h
+1
-1
No files found.
bigfile/virtmem.c
View file @
8a00147e
...
@@ -474,7 +474,6 @@ void fileh_dirty_discard(BigFileH *fileh)
...
@@ -474,7 +474,6 @@ void fileh_dirty_discard(BigFileH *fileh)
pagemap_del
(
&
fileh
->
pagemap
,
page
->
f_pgoffset
);
pagemap_del
(
&
fileh
->
pagemap
,
page
->
f_pgoffset
);
page_drop_memory
(
page
);
page_drop_memory
(
page
);
page_del
(
page
);
page_del
(
page
);
// XXX wcfs: remmap page(s) to base file
}
}
BUG_ON
(
!
list_empty
(
&
fileh
->
dirty_pages
));
BUG_ON
(
!
list_empty
(
&
fileh
->
dirty_pages
));
...
@@ -1063,9 +1062,19 @@ static void vma_page_ensure_unmapped(VMA *vma, Page *page)
...
@@ -1063,9 +1062,19 @@ static void vma_page_ensure_unmapped(VMA *vma, Page *page)
if
(
!
vma_page_ismapped
(
vma
,
page
))
if
(
!
vma_page_ismapped
(
vma
,
page
))
return
;
return
;
/* mmap empty PROT_NONE address space instead of page memory */
if
(
vma
->
mmap_overlay
)
{
// XXX overlay: remmap to base image
/* wcfs: remmap readonly to base image */
mem_xvalloc
(
vma_page_addr
(
vma
,
page
),
page_size
(
page
));
BigFile
*
file
=
vma
->
fileh
->
file
;
int
err
;
TODO
(
file
->
blksize
!=
page_size
(
page
));
err
=
file
->
file_ops
->
remmap_blk_read
(
file
,
page
->
f_pgoffset
/* =blk */
,
vma
);
BUG_ON
(
err
);
/* must not fail */
}
else
{
/* !wcfs: mmap empty PROT_NONE address space instead of page memory */
mem_xvalloc
(
vma_page_addr
(
vma
,
page
),
page_size
(
page
));
}
bitmap_clear_bit
(
vma
->
page_ismappedv
,
page
->
f_pgoffset
-
vma
->
f_pgoffset
);
bitmap_clear_bit
(
vma
->
page_ismappedv
,
page
->
f_pgoffset
-
vma
->
f_pgoffset
);
page_decref
(
page
);
page_decref
(
page
);
...
...
include/wendelin/bigfile/file.h
View file @
8a00147e
...
@@ -72,6 +72,11 @@ struct bigfile_ops {
...
@@ -72,6 +72,11 @@ struct bigfile_ops {
int
(
*
storeblk
)
(
BigFile
*
file
,
blk_t
blk
,
const
void
*
buf
);
int
(
*
storeblk
)
(
BigFile
*
file
,
blk_t
blk
,
const
void
*
buf
);
// - mmap_setup_read(file[blk +blklen), vma) setup initial read-only mmap to serve vma
// - remmap_blk_read(file[blk], vma) remmap blk into vma again, after e.g.
// RW dirty page was discarded
// - munmap(vma) before VMA is unmapped
/* mmap_setup_read is called to setup new read-only mapping of file[blk +blklen).
/* mmap_setup_read is called to setup new read-only mapping of file[blk +blklen).
*
*
* The mapping will be used as the base read-only layer for vma.
* The mapping will be used as the base read-only layer for vma.
...
@@ -82,12 +87,14 @@ struct bigfile_ops {
...
@@ -82,12 +87,14 @@ struct bigfile_ops {
* @addr NULL - mmap at anywhere, !NULL - mmap exactly at addr.
* @addr NULL - mmap at anywhere, !NULL - mmap exactly at addr.
* @return !NULL - mapped there, NULL - error.
* @return !NULL - mapped there, NULL - error.
*/
*/
// void* (*mmap_read) (BigFile *file, void *addr, blk_t blk, size_t blklen);
void
*
(
*
mmap_setup_read
)
(
BigFile
*
file
,
blk_t
blk
,
size_t
blklen
,
VMA
*
vma
);
void
*
(
*
mmap_setup_read
)
(
BigFile
*
file
,
blk_t
blk
,
size_t
blklen
,
VMA
*
vma
);
// - mmap_setup_read(vma) setup initial read-only mmap
// - mresync(vma, was_dirtyv) forget RW dirty pages -> mmap them back read-only to file data
// XXX
// - munmap(vma) before VMA is unmapped
// XXX error -> bug (must not fail)
int
(
*
remmap_blk_read
)
(
BigFile
*
file
,
blk_t
,
VMA
*
vma
);
/* release is called to release resources associated with file.
/* release is called to release resources associated with file.
...
...
include/wendelin/bigfile/ram.h
View file @
8a00147e
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
* - need to "unload" non-dirty pages to free place for requested new data (reclaim)
* - need to "unload" non-dirty pages to free place for requested new data (reclaim)
*
*
* - need to be able to map a page into several places (to support
* - need to be able to map a page into several places (to support
* overlapping-in-file mappings done not nec
c
essarily adjacent-in-time to
* overlapping-in-file mappings done not necessarily adjacent-in-time to
* each other - there is no guarantee mapping them adjacent in address space
* each other - there is no guarantee mapping them adjacent in address space
* is possible)
* is possible)
*
*
...
...
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