Commit 27d91d47 authored by Kirill Smelkov's avatar Kirill Smelkov

X δFtail settled

parent fee4a7e4
...@@ -265,7 +265,10 @@ package main ...@@ -265,7 +265,10 @@ package main
// //
// - try to retrieve file/head/data[blk] from OS file cache; // - try to retrieve file/head/data[blk] from OS file cache;
// - if retrieved successfully -> store retrieved data into OS file cache // - if retrieved successfully -> store retrieved data into OS file cache
// for file/@<rev>/data[blk]; XXX @rev = what? (ideally exact previous rev of blk) // for file/@<rev>/data[blk].
//
// rev = max(δFtail.by(#blk)) || zconn.at
//
// - invalidate file/head/data[blk] in OS file cache. // - invalidate file/head/data[blk] in OS file cache.
// //
// This preserves previous data in OS file cache in case it will be needed // This preserves previous data in OS file cache in case it will be needed
...@@ -273,39 +276,49 @@ package main ...@@ -273,39 +276,49 @@ 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.
// //
// - for file δFtail invalidation info is maintained: // - for every file δFtail invalidation info about head/data is maintained:
//
// - tail of [](rev↑, []#blk)
// - {} #blk -> []rev↑ in tail XXX needed?
//
// δFtail describes changes to file we learned from ZODB invalidation.
// XXX and allows to quick #blk -> ... ?
// //
// - XXX δZtail of invalidation info is maintained. // - tail: of [](rev↑, []#blk)
// - by: {} #blk -> []rev↑ in tail
// //
// - tail of [](tid↑, []oid) // δFtail.tail describes invalidations to file we learned from ZODB invalidation.
// - {} oid -> []tid↑ in tail // δFtail.by allows to quickly lookup information by #blk.
// //
// min(tid) in δZtail is min(@at) at which */head/data is currently mmapped. // min(rev) in δFtail is min(@at) at which head/data is currently mmapped.
// //
// - when we receive a FUSE read(#blk) request to a file/head/data we process it as follows: // - when we receive a FUSE read(#blk) request to a file/head/data we process it as follows:
// //
// 1. load blkdata for head/data[blk] @zconn.at . // 1. load blkdata for head/data[blk] @zconn.at .
// this also gives upper bound estimate of when the block was last changed:
// //
// rev(blk) ≤ max(_.serial for _ in (ZBlk(#blk), all BTree/Bucket that lead to ZBlk)) // while loading this also gives upper bound estimate of when the block
// was last changed:
// //
// XXX it is not exact because BTree/Bucket can change (e.g. rebalance) // rev(blk) ≤ max(_.serial for _ in (ZBlk(#blk), all BTree/Bucket that lead to ZBlk))
//
// it is not exact because BTree/Bucket can change (e.g. rebalance)
// but still point to the same k->ZBlk. // but still point to the same k->ZBlk.
// XXX if we maintain δBTree tail we can maybe get rev(blk) as exact? //
// we also use file.δFtail to find either exact blk revision:
//
// rev(blk) = max(file.δFtail.by(#blk) -> []rev↑)
//
// or another upper bound if #blk ∉ δFtail:
//
// rev(blk) ≤ min(rev) is δFtail ; #blk ∉ δFtail
//
//
// below rev'(blk) is min(of the numbers found):
//
// rev(blk) ≤ rev'(blk) rev'(blk) = min(^^^)
//
// //
// 2. for all client/addr@at mmappings of file/head/data: // 2. for all client/addr@at mmappings of file/head/data:
// //
// - rev(blk) ≤ at: -> do nothing // - rev'(blk) ≤ at: -> do nothing
// - rev(blk) > at: // - rev'(blk) > at:
// - if blk mmapping.pinned -> do nothing // - if blk mmapping.pinned -> do nothing
// - client.remmap(addr[blk], file/@at/data) XXX @at -> @revprev(blk) better? // - rev = max(δFtail.by(#blk) : _ ≤ at) || at
// XXX @at -> @prevrev(file) even more better? // - client.remmap(addr[blk], file/@rev/data)
// - mmapping.pinned += blk // - mmapping.pinned += blk
// //
// remmapping is done synchronously via ptrace. // remmapping is done synchronously via ptrace.
...@@ -317,8 +330,6 @@ package main ...@@ -317,8 +330,6 @@ package main
// //
// is maintained. // is maintained.
// //
// XXX δZ is consulted to find out which client needs such update?
//
// 3. blkdata is returned to kernel. // 3. blkdata is returned to kernel.
// //
// Thus a client that wants latest data on pagefault will get latest data, // Thus a client that wants latest data on pagefault will get latest data,
......
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