Skip to content
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

Handle all decommits/madvise(DONTNEED)s homogenously #8587

Merged
merged 2 commits into from
May 9, 2024

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented May 8, 2024

We previously had different functions for tables vs memories vs stacks vs etc...

Now we use the same system virtual memory interface function for all of them. This enables follow up PRs where we will start batching these calls together (and potentially merging regions together in the further future, although that isn't a clear win as we've seen larger madvises take longer than small ones in the past). Those future batching PRs will allow us to in turn start prototyping new syscalls that can take advantage of that batching, like madvisev.

All implementations are the same either way, and by treating them differently,
it makes it difficult to prototype integration with batching syscalls that need
to treat them homogenously.

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>
@fitzgen fitzgen requested a review from a team as a code owner May 8, 2024 23:52
@fitzgen fitzgen requested review from alexcrichton and removed request for a team May 8, 2024 23:52
@fitzgen
Copy link
Member Author

fitzgen commented May 8, 2024

cc #4637

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it 👍

… interface

This was already implemented by the existing `decommit_pages` function, we just
need to determine what the behavior is for the left over mapping. Specifically,
whether it is zeroed or restored to the original mapping (e.g. a CoW image).

This allows us to handle `decommit_pages` and what previously were calls to
`madvise_dontneed` homogenously, which enables us to prototype new system calls
that batch decommits together and therefore must treat them all the same.

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>
@fitzgen fitzgen enabled auto-merge May 9, 2024 00:49
@fitzgen fitzgen added this pull request to the merge queue May 9, 2024
Merged via the queue into bytecodealliance:main with commit aa2beae May 9, 2024
22 checks passed
@fitzgen fitzgen deleted the just-decommit branch May 9, 2024 01:28
fitzgen added a commit to fitzgen/wasmtime that referenced this pull request May 14, 2024
…iance#8587)

* Don't differentiate between decommitting table vs stack pages

All implementations are the same either way, and by treating them differently,
it makes it difficult to prototype integration with batching syscalls that need
to treat them homogenously.

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>

* Remove the `madvise_dontneed` function from the system virtual memory interface

This was already implemented by the existing `decommit_pages` function, we just
need to determine what the behavior is for the left over mapping. Specifically,
whether it is zeroed or restored to the original mapping (e.g. a CoW image).

This allows us to handle `decommit_pages` and what previously were calls to
`madvise_dontneed` homogenously, which enables us to prototype new system calls
that batch decommits together and therefore must treat them all the same.

Co-Authored-By: Jamey Sharp <jsharp@fastly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants