-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add no-op syscall.dropImports to vat-kernel protocol #2635
Comments
In my branch, My |
The new `vatPowers.disavow` doesn't do anything yet, but is at least exercised by test-liveslots.js The `enableDisavow` option is only available for static vats. The `endow` function cannot be enabled on dynamic vats. refs #2636, but won't close it until #2635 is implemented and `disavow()` routes into `syscall.dropImports()`
Vat code can now use `vatPowers.disavow(presence)` (if enabled for that vat), which will invoke `syscall.dropImports`. The kernel will delete the entry from the vat's c-list, however no further reference-count management will occur (that is scheduled for #2646). This should be enough to allow work to proceed on liveslots (using WeakRef and FinalizationRegistry) in parallel with kernel-side improvements. Note that referencing a disavowed object is vat-fatal, either as the target of a message, the argument of a message, or the resolution of a promise. closes #2635 closes #2636
The new `vatPowers.disavow` doesn't do anything yet, but is at least exercised by test-liveslots.js The `enableDisavow` option is only available for static vats. The `endow` function cannot be enabled on dynamic vats. refs #2636, but won't close it until #2635 is implemented and `disavow()` routes into `syscall.dropImports()`
Vat code can now use `vatPowers.disavow(presence)` (if enabled for that vat), which will invoke `syscall.dropImports`. The kernel will delete the entry from the vat's c-list, however no further reference-count management will occur (that is scheduled for #2646). This should be enough to allow work to proceed on liveslots (using WeakRef and FinalizationRegistry) in parallel with kernel-side improvements. Note that referencing a disavowed object is vat-fatal, either as the target of a message, the argument of a message, or the resolution of a promise. closes #2635 closes #2636
Note that |
The new `vatPowers.disavow` doesn't do anything yet, but is at least exercised by test-liveslots.js The `enableDisavow` option is only available for static vats. The `endow` function cannot be enabled on dynamic vats. refs #2636, but won't close it until #2635 is implemented and `disavow()` routes into `syscall.dropImports()`
Vat code can now use `vatPowers.disavow(presence)` (if enabled for that vat), which will invoke `syscall.dropImports`. The kernel will delete the entry from the vat's c-list, however no further reference-count management will occur (that is scheduled for #2646). This should be enough to allow work to proceed on liveslots (using WeakRef and FinalizationRegistry) in parallel with kernel-side improvements. Note that referencing a disavowed object is vat-fatal, either as the target of a message, the argument of a message, or the resolution of a promise. closes #2635 closes #2636
What is the Problem Being Solved?
The first steps of the #2615 GC task includes the creation of a
syscall.dropImports(vrefs)
, which accepts a list of vat references (e.g.o-12
) that the vat has stopped using. Eventually this will be triggered byFinalizationRegistry
callbacks at end-of-crank. Eventually the kernel will process thedropImports
by decrementing refcounts and releasing other objects. But for now, merely having a no-op syscall will be sufficient to allow both of those future steps to be developed in parallel.The vrefs will be limited to object IDs for now, I don't think we have a clear understanding of how we could drop unreferenced unresolved promises correctly, and the GC problem is less severe for Promises because most of them get resolved sooner or later, and we already have a working mechanism for retiring and releasing resolved promise IDs.
Description of the Design
syscall.dropImports([vrefs])
dropImports
can be called at any time during the crank. Normal vats will only call it at end-of-crank (driven by liveslots checking the finalizers), but the comms vat will call it in response to many inboundcomms.dropImport
messages (Cope with asynchrony in remote retirement of promise IDs #2509 (comment)) that are freely interleaved with other syscalls.o-NN
(imports), noto+NN
(exports): we'll use a different mechanism for revoke a Remotable #2070 object revocation, because those will need an Error to go along with eachSecurity Considerations
Test Plan
I intend to write unit tests to assert that this syscall can be made from all our vat runners. Since we decided the XS vat runner didn't need to support
setup
-based "raw vats", I need a way to reliably triggerdropImports
from user-level vat code. When we get the vat-side finalizers (and explicitgc()
invocation) working, this will be as simple as not retaining the imported Presence, but until that point we need some other way to triggerdropImports
.I propose to add a
vatPowers.disavow(presence)
function, disabled by default, that can trigger adropImports
. #2636has the writeup of that proposal.
The text was updated successfully, but these errors were encountered: