Commit 90f869ab authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1fde1d07
...@@ -41,6 +41,13 @@ https://lwn.net/ml/linux-fsdevel/20190315212556.9315-1-kirr%40nexedi.com/ ...@@ -41,6 +41,13 @@ https://lwn.net/ml/linux-fsdevel/20190315212556.9315-1-kirr%40nexedi.com/
Invalidations to wcfs clients are delayed until block access Invalidations to wcfs clients are delayed until block access
============================================================ ============================================================
XXX patial invalidations (only for those blocks that are in OS cache) could be
still handled at zδhandle (txn boundary) time. The reason we handle them lazily
is probably to avoid unneccessary notifications (i.e. if part of a file is
mmaped, but changed block is out of mmaped region - there won't be reads
covering that block and thus no pin messages with that block at all)
XXX -> describe that in text.
Initially it was planned that wcfs would send invalidation messages to its Initially it was planned that wcfs would send invalidation messages to its
clients right after receiving invalidation message from ZODB at transaction clients right after receiving invalidation message from ZODB at transaction
boundary time. That simplifies logic but requires that for a particular file, boundary time. That simplifies logic but requires that for a particular file,
......
...@@ -289,7 +289,7 @@ package main ...@@ -289,7 +289,7 @@ package main
// won't be served from OS file cache and instead will trigger a FUSE read // won't be served from OS file cache and instead will trigger a FUSE read
// request to wcfs. // request to wcfs.
// //
// 4.5) no invalidation messages are sent to wcfs clients at this point(+). // 4.5) no invalidation messages are sent to wcfs clients at this point(+). XXX rethink
// //
// 4.6) processing ZODB invalidations and serving file reads (see 7) are // 4.6) processing ZODB invalidations and serving file reads (see 7) are
// organized to be mutually exclusive. // organized to be mutually exclusive.
...@@ -471,6 +471,8 @@ type Head struct { ...@@ -471,6 +471,8 @@ type Head struct {
// XXX move zconn's current transaction to Head here? // XXX move zconn's current transaction to Head here?
// XXX move watchTab here?
} }
// /head/watch - served by Watch. // /head/watch - served by Watch.
...@@ -487,6 +489,9 @@ type Watcher struct { ...@@ -487,6 +489,9 @@ type Watcher struct {
sk *FileSock sk *FileSock
// XXX // XXX
// fileTab: BigFile ->
// at
// pinned = ... XXX
} }
// /(head|<rev>)/bigfile/ - served by BigFileDir. // /(head|<rev>)/bigfile/ - served by BigFileDir.
...@@ -1615,9 +1620,19 @@ func main() { ...@@ -1615,9 +1620,19 @@ func main() {
gmntpt = mntpt gmntpt = mntpt
// we require proper pagecache control (added to Linux 2.6.36 in 2010) // we require proper pagecache control (added to Linux 2.6.36 in 2010)
supports := fssrv.KernelSettings().SupportsNotify kinit := fssrv.KernelSettings()
kfuse := fmt.Sprintf("kernel FUSE (API %d.%d)", kinit.Major, kinit.Minor)
supports := kinit.SupportsNotify
if !(supports(fuse.NOTIFY_STORE_CACHE) && supports(fuse.NOTIFY_RETRIEVE_CACHE)) { if !(supports(fuse.NOTIFY_STORE_CACHE) && supports(fuse.NOTIFY_RETRIEVE_CACHE)) {
log.Fatalf("kernel FUSE does not support pagecache control") log.Fatalf("%s does not support pagecache control", kfuse)
}
// make a bold warning if kernel does not support precise cache invalidation
// (patch sent upstream; see notes.txt -> "Notes on OS pagecache control")
if kinit.Flags & fuse.CAP_PRECISE_INVAL_DATA == 0 {
w1 := fmt.Sprintf("%s does not support precise data cache invalidation", kfuse)
w2 := "-> performance will be AWFUL."
log.Error(w1); log.Error(w2)
fmt.Fprintf(os.Stderr, "W: wcfs: %s\nW: wcfs: %s\n", w1, w2)
} }
// add entries to / // add entries to /
......
...@@ -594,10 +594,22 @@ def test_wcfs(): ...@@ -594,10 +594,22 @@ def test_wcfs():
assert w.sendReq(b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok" assert w.sendReq(b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok"
done.recv() done.recv()
# XXX test watch with all at variants
# XXX both from scratch and going e.g. at1 -> at2 -> at3
# XXX going not only up, but also down at1 <- at2 <- at3
w = t.watch(zf, at1) # XXX <- pin @at2 @at3 w = t.watch(zf, at1) # XXX <- pin @at2 @at3
#t.watch(zf, at1, {2: at1, 3: at1}) # XXX <- pin @at2 @at3 #t.watch(zf, at1, {2: at1, 3: at1}) # XXX <- pin @at2 @at3
# XXX 2 (or more) opened watch for 1 file at the same time
# XXX watch for 2 files via single watch open
# XXX watch with @at > head - must wait for head to become >= at
# XXX watch with @at < δtail.tail -> rejected
# XXX watch with at="-" -> stop watching
# XXX drop file[blk] from cache, access again -> no pin message sent the second time
# XXX mmap f; change f[blk] on pin message while under pagefault - should get changed page
......
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