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

unpack_ram: More graceful handling of low unpack ram #2780

Merged
merged 1 commit into from
May 29, 2021

Conversation

kinnison
Copy link
Contributor

Some people try setting RUSTUP_UNPACK_RAM below the minimum
RAM needed for a threaded operation. Since, in principle,
we need at least IO_CHUNK_SIZE and thus in theory 2x IO_CHUNK_SIZE,
this change softens the failure mode from a panic to a warning
and then tries anyway. This is likely to succeed and as such
we'll let it happen. The warning should make it clear if there's
a problem, and should not appear for no-sysinfo platforms since
they default to minimum_ram anyway.

fix #2771

@kinnison kinnison requested a review from rbtcollins May 23, 2021 09:36
@kinnison
Copy link
Contributor Author

I think that sorts things out.

Some people try setting RUSTUP_UNPACK_RAM below the minimum
RAM needed for a threaded operation.  Since, in principle,
we need at least IO_CHUNK_SIZE and thus in theory 2x IO_CHUNK_SIZE,
this change clamps the unpack RAM between minimum_ram and
the computed maximum available RAM.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
@kinnison
Copy link
Contributor Author

Cleaned up commit message, restored panic, and took your suggested message form.

@rbtcollins rbtcollins merged commit c8be2a3 into rust-lang:master May 29, 2021
@kinnison kinnison deleted the graceful-lowmem branch May 30, 2021 15:05
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.

Slab allocator panics if unpack RAM is manually set too low (or machine has < 32MB of RAM).
2 participants