Stream: git-wasmtime

Topic: wasmtime / PR #13830 Optionally use `process_madvise` on ...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 19:47):

alexcrichton opened PR #13830 from alexcrichton:process-madvise to bytecodealliance:main:

This commit adds support to use the process_madvise syscall on Linux
when decommitting regions of pages for the pooling allocator. This was
evaluated some time ago and found to be insufficient because it didn't
support MADV_DONTNEED, but nowadays that's supported when you're
advising your own process. This makes it a perfect match for Wasmtime's
needs and its DecommitQueue, so this PR adds bindings to it.

This requires a fairly recent kernel after 6.13, and the usage of
PIDFD_SELF in the implementation additionally requires a kernel after
6.14. This is additionally disabled-by-default as this path is only
taken when the decommit batch size is larger than 1, and currently the
batch size is default to 1. In the future if this proves beneficial it
might make sense to increase the default batch size when Linux supports
this syscall behavior to something larger than 1.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 19:47):

alexcrichton requested fitzgen for a review on PR #13830.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 19:47):

alexcrichton requested wasmtime-core-reviewers for a review on PR #13830.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 19:48):

alexcrichton edited PR #13830:

This commit adds support to use the process_madvise syscall on Linux
when decommitting regions of pages for the pooling allocator. This was
evaluated some time ago and found to be insufficient because it didn't
support MADV_DONTNEED, but nowadays that's supported when you're
advising your own process. This makes it a perfect match for Wasmtime's
needs and its DecommitQueue, so this PR adds bindings to it.

This requires a fairly recent kernel after 6.13, and the usage of
PIDFD_SELF in the implementation additionally requires a kernel after
6.14. This is additionally disabled-by-default as this path is only
taken when the decommit batch size is larger than 1, and currently the
batch size is default to 1. In the future if this proves beneficial it
might make sense to increase the default batch size when Linux supports
this syscall behavior to something larger than 1.

Note: this is currently built on #13827

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 19:56):

fitzgen commented on PR #13830:

Out of curiosity, did you measure any speedups on e.g. benches/wasmtime-serve-rps.sh with this change?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 19:59):

:thumbs_up: fitzgen submitted PR review:

Second commit LGTM!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 20:20):

alexcrichton commented on PR #13830:

Locally in perf profiles I can see IPI contention disappear entirely, but it's replaced by contention on the pooling allocator lock. The script locally decreases from 192k to 185k with this change (and when the batch size is increased to >=8). I'm gonna dig a little bit into the contention and see if there's something we can do about it.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 22:05):

github-actions[bot] added the label wasmtime:api on PR #13830.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 22:44):

alexcrichton updated PR #13830.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 22:45):

alexcrichton has enabled auto merge for PR #13830.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 22:57):

alexcrichton updated PR #13830.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 23:07):

alexcrichton added PR #13830 Optionally use process_madvise on Linux to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 23:45):

:check: alexcrichton merged PR #13830.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 06 2026 at 23:45):

alexcrichton removed PR #13830 Optionally use process_madvise on Linux from the merge queue.


Last updated: Jul 29 2026 at 05:03 UTC