Commit 5da97fd3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 94e06c4a
......@@ -288,7 +288,7 @@ int fileh_mmap(VMA *vma, BigFileH *fileh, pgoff_t pgoffset, pgoff_t pglen)
if (!(pgoffset <= page->f_pgoffset && page->f_pgoffset < pgoffset + pglen))
continue; /* page is out of requested mmap coverage */
// XXX notify watcher that we mmap RAM page in its range?
// XXX notify watcher that we mmap RAM page in its range? -> no need
vma_mmap_page(vma, page);
}
}
......
......@@ -81,9 +81,21 @@ struct bigfile_ops {
*
* The mapping will be used as the base read-only layer for vma.
*
* XXX bigfile backend owns setup mapping and can change it dynamically
* e.g. due to changes to the file from outside. However it should XXX
* check dirtyv and if dirty=1 not change that page until remmap_blk_read.
* After setup bigfile backend manages the mapping and can change it dynamically
* e.g. due to changes to the file from outside. However before changing a page,
* the backend must check if that page was already dirtied by virtmeme and if
* so don't change that page until virtmem calls .remmap_blk_read.
*
* The checking has to be done with virtmem lock held. A sketch of mapping
* update sequence is as below:
*
* # backend detects that block is changed from outside
* # fileh is vma->fileh - file handle with which the vma is associated
* virt_lock()
* if (!fileh_blk_isdirty(fileh, blk)) {
* // update mappings for all fileh's vma that cover blk
* }
* virt_unlock()
*
* XXX called under virtmem lock?
*
......@@ -96,7 +108,9 @@ struct bigfile_ops {
void* (*mmap_setup_read) (BigFile *file, blk_t blk, size_t blklen, VMA *vma);
// XXX
// remmap_blk_read is called to remmap a block into vma again, after e.g.
// RW dirty page was discarded.
//
// XXX called under virtmem lock?
//
// XXX error -> bug (must not fail)
......
......@@ -21,7 +21,7 @@
"""Module wcfs.py provides python gateway for spawning and interoperating with wcfs server
Join(zurl) joins wcfs server. If wcfs server for zurl is not yet running, it
will be automatically started if `autostart=True` parameter is passed to join.
will be automatically started if `autostart=True` is passed to join.
It will also be automatically started by default unless
$WENDELIN_CORE_WCFS_AUTOSTART=no is specified in environment.
......@@ -233,10 +233,16 @@ def _pin1(wconn, req):
trace('\tremmapblk %d @%s' % (req.blk, (h(req.at) if req.at else "head")))
# FIXME check if virtmem did not mapped RW page into this block already
mmap._remmapblk(req.blk, req.at)
# -> check if virtmem did not dirtied page corresponding to this block already
virt_lock()
if not fileh_blk_isdirty(mmap.fileh, req.blk):
mmap._remmapblk(req.blk, req.at)
virt unlock()
trace('\t-> remmaped')
# update f.pinned
# XXX do it before ^^^ remmapblk (so that e.g. concurrent
# discard/writeout see correct f.pinned) ?
if req.at is None:
f.pinned.pop(req.blk, None) # = delete(f.pinned, req.blk) -- unpin to @head
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment