Stream: git-wasmtime

Topic: wasmtime / PR #3925 Delete historical interruptable suppo...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 15:40):

alexcrichton opened PR #3925 from delete-interurpts to main:

This commit removes the Config::interruptable configuration along with
the InterruptHandle type from the wasmtime crate. The original
support for adding interruption to WebAssembly was added pretty early on
in the history of Wasmtime when there was no other method to prevent an
infinite loop from the host. Nowadays, however, there are alternative
methods for interruption such as fuel or epoch-based interruption.

One of the major downsides of Config::interruptable is that even when
it's not enabled it forces an atomic swap to happen when entering
WebAssembly code. This technically could be a non-atomic swap if the
configuration option isn't enabled but that produces even more branch-y
code on entry into WebAssembly which is already something we try to
optimize. Calling into WebAssembly is on the order of a dozens of
nanoseconds at this time and an atomic swap, even uncontended, can add
up to 5ns on some platforms.

The main goal of this PR is to remove this atomic swap on entry into
WebAssembly. This is done by removing the Config::interruptable field
entirely, moving all existing consumers to epochs instead which are
suitable for the same purposes. This means that the stack overflow check
is no longer entangled with the interruption check and perhaps one day
we could continue to optimize that further as well.

Some consequences of this change are:

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 15:40):

alexcrichton updated PR #3925 from delete-interurpts to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:02):

alexcrichton updated PR #3925 from delete-interurpts to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:10):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:10):

cfallin created PR review comment:

Should we note here that it's also signal-safe (I think we have a similar note in the rustdoc text)?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:10):

cfallin created PR review comment:

Update type here in the doc comment (VMRuntimeLimits)?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:10):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:10):

cfallin created PR review comment:

    /// WebAssembly code by instrumenting generated code to consume fuel as it

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:10):

cfallin created PR review comment:

    /// This can be used to deterministically prevent infinitely-executing

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:21):

alexcrichton updated PR #3925 from delete-interurpts to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:39):

sunfishcode submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 16:39):

sunfishcode created PR review comment:

 * \brief Configures WASI state within the specified store.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 18:24):

alexcrichton updated PR #3925 from delete-interurpts to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2022 at 20:25):

alexcrichton merged PR #3925.


Last updated: Oct 23 2024 at 20:03 UTC