Commit c4eaa69f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5e83136a
......@@ -339,23 +339,33 @@ package main
// rev(blk) ≤ rev'(blk) rev'(blk) = min(^^^)
//
//
// 7.2) for all client@at mmappings of head/bigfile/file:
// 7.2) for all registered client@at watchers of head/bigfile/file:
//
// - rev'(blk) ≤ at: -> do nothing XXX if rev is not last and there is rev_next ≤ at ? -> also consult δFtail ?
// - rev'(blk) ≤ at: -> do nothing
// - rev'(blk) > at:
// - if blk ∈ mmapping.pinned -> do nothing
// - if blk ∈ watcher.pinned -> do nothing
// - rev = max(δFtail.by(#blk) : _ ≤ at) || min(rev ∈ δFtail : rev ≤ at) || at
// - client.remmap(file, #blk, @rev/bigfile/file)
// - mmapping.pinned += blk
// - watcher.pin(file, #blk, @rev)
// - watcher.pinned += blk
//
// where
//
// watcher.pin(file, #blk, @rev)
//
// sends pin message according to "Invalidation protocol", and is assumed
// to cause
//
// remmap(file, #blk, @rev/bigfile/file)
//
// on client.
//
// remmapping is done via "invalidation protocol" exchange with client.
// ( one could imagine adjusting mappings synchronously via running
// wcfs-trusted code via ptrace that wcfs injects into clients, but ptrace
// won't work when client thread is blocked under pagefault or syscall(^) )
//
// in order to support remmapping for each head/bigfile/file
// in order to support watching for each head/bigfile/file
//
// [] of mmapping{client@at↑, pinned}
// [] of watch{client@at↑, pinned}
//
// is maintained.
//
......@@ -562,7 +572,7 @@ func (_ *zodbCacheControl) PCacheClassify(obj zodb.IPersistent) zodb.PCachePolic
// for performance reason we also keep ZBigFile in cache.
//
// ZBigFile is top-level object that is used on every block load, and
// it would be a waste to evict ZBigFile state from cache.
// it would be a waste to evict ZBigFile from cache.
case *ZBigFile:
return zodb.PCachePinObject | zodb.PCacheKeepState
}
......
......@@ -90,9 +90,6 @@ type zBlk interface {
blkBoundTo() map[*ZBigFile]SetI64
}
// module of Wendelin ZODB py objects
const zwendelin = "wendelin.bigfile.file_zodb"
// ---- zBlkBase ----
// zBlkBase provides common functionality to implement ZBlk* -> zfile, #blk binding.
......@@ -534,6 +531,9 @@ func (bf *ZBigFile) Size(ctx context.Context) (_ int64, treePath []zodb.IPersist
// ----------------------------------------
// module of Wendelin ZODB py objects
const zwendelin = "wendelin.bigfile.file_zodb"
func init() {
t := reflect.TypeOf
zodb.RegisterClass(zwendelin + ".ZBlk0", t(ZBlk0{}), t(zBlk0State{}))
......
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