Commit 38ea1ad3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 926c30b4
...@@ -141,6 +141,9 @@ Starting from Linux 5.1 mmap_sem should be generally released while doing any IO ...@@ -141,6 +141,9 @@ Starting from Linux 5.1 mmap_sem should be generally released while doing any IO
but before that the analysis remains FUSE-specific. but before that the analysis remains FUSE-specific.
The property that changing mmapping while under pagefault is possible is
verified by wcfs testsuite in `test_wcfs_remmap_on_pin` test.
Client cannot be ptraced while under pagefault Client cannot be ptraced while under pagefault
============================================== ==============================================
......
...@@ -359,18 +359,18 @@ package main ...@@ -359,18 +359,18 @@ package main
// using just cheap revmax estimate can frequently result in all watches // using just cheap revmax estimate can frequently result in all watches
// being skipped. // being skipped.
// //
// 7.2) for all registered client@at watchers of head/bigfile/file: // 7.2) for all registered client@at watches of head/bigfile/file:
// //
// - rev'(blk) ≤ at: -> do nothing // - rev'(blk) ≤ at: -> do nothing
// - rev'(blk) > at: // - rev'(blk) > at:
// - if blk ∈ watcher.pinned -> do nothing // - if blk ∈ watch.pinned -> do nothing
// - rev = max(δtail.by(#blk) : _ ≤ at) || min(rev ∈ δtail : rev ≤ at) || at // - rev = max(δtail.by(#blk) : _ ≤ at) || min(rev ∈ δtail : rev ≤ at) || at
// - watcher.pin(file, #blk, @rev) // - watch.pin(file, #blk, @rev)
// - watcher.pinned += blk // - watch.pinned += blk
// //
// where // where
// //
// watcher.pin(file, #blk, @rev) // watch.pin(file, #blk, @rev)
// //
// sends pin message according to "Invalidation protocol", and is assumed // sends pin message according to "Invalidation protocol", and is assumed
// to cause // to cause
...@@ -1004,6 +1004,7 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) { ...@@ -1004,6 +1004,7 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) {
delete(f.loading, blk) delete(f.loading, blk)
} }
// XXX skip retrieve/store if len(f.watches) == 0
// try to retrieve cache of current head/data[blk], if we got nothing from f.loading // try to retrieve cache of current head/data[blk], if we got nothing from f.loading
if blkdata == nil { if blkdata == nil {
blkdata = make([]byte, blksize) blkdata = make([]byte, blksize)
......
...@@ -1682,6 +1682,9 @@ def test_wcfs_watch_vs_access(): ...@@ -1682,6 +1682,9 @@ def test_wcfs_watch_vs_access():
# verify that on pin message, while under pagefault, we can mmap @at/f[blk] # verify that on pin message, while under pagefault, we can mmap @at/f[blk]
# into where head/f[blk] was mmaped; the result of original pagefaulting read # into where head/f[blk] was mmaped; the result of original pagefaulting read
# must be from newly insterted mapping. # must be from newly insterted mapping.
#
# TODO same with two mappings to the same file, but only one changing blk mmap
# -> one read gets changed data, one read gets data from @head.
@func @func
def test_wcfs_remmap_on_pin(): def test_wcfs_remmap_on_pin():
t = tDB(); zf = t.zfile t = tDB(); zf = t.zfile
......
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