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

Rename dont_need to discard and mention decommit as an option #388

Merged
merged 1 commit into from
Oct 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions FutureFeatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ Provide access to safe OS-provided functionality including:
copies the specified range from `Blob` into the range `[addr, addr+length)`
(where `addr+length <= memory_size`) but implementations are encouraged
to `mmap(addr, length, MAP_FIXED | MAP_PRIVATE, fd)`
* `dont_need(addr, length)`: semantically, this operation zeroes the given range
but the implementation is encouraged to `madvise(addr, length, MADV_DONTNEED)`
(this allows applications to be good citizens and release unused physical
pages back to the OS, thereby reducing their RSS and avoiding OOM-killing on
mobile)
* `discard(addr, length)`: semantically, this operation zeroes the given range
but the implementation is encouraged to drop the zeroed physical pages from
the process's working set (e.g., by calling `madvise(MADV_DONTNEED)` on
POSIX)
* `shmem_create(length)`: create a memory object that can be simultaneously
shared between multiple linear memories
* `map_shmem(addr, length, shmem, shmem-offset)`: like `map_file` except
`MAP_SHARED`, which isn't otherwise valid on read-only Blobs
* `mprotect(addr, length, prot-flags)`: change protection on the range
`[addr, addr+length)` (where `addr+length <= memory_size`)
* `decommit(addr, length)`: equivalent to `mprotect(addr, length, PROT_NONE)`
followed by `discard(addr, length)` and potentially more efficient than
performing these operations in sequence.
Copy link
Member

Choose a reason for hiding this comment

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

Getting PROT_NONE has a bigger meaning that decommitting IMO. I'm not sure what name would be better... "void" has other meanings.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. Are you commenting on the naming of decommit?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but without a better name to suggest I'll lgtm and hope someone else comes up with a nicer name before you commit :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hah, thanks. As we see here with dont_need=>discard, we can always rename.


The `addr` and `length` parameters above would be required to be multiples of
[`page_size`](AstSemantics.md#resizing).
Expand Down