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

rt: Release big stacks immediately after use to avoid holding on to them... #7111

Merged
merged 1 commit into from
Jun 27, 2013

Conversation

brson
Copy link
Contributor

@brson brson commented Jun 13, 2013

... through yields

This avoids the following pathological scenario that makes threadring OOM:

  1. task calls C using fast_ffi, borrowing a big stack from the scheduler.
  2. task returns from C and places the big stack on the task-local stack segment list
  3. task calls further Rust functions that require growing the stack, and for this reuses the big stack
  4. task yields, failing to return the big stack to the scheduler.
  5. repeat 500+ times and OOM

(reopening after incoming fallout. do not r+. broken)

…hem through yields

This avoids the following pathological scenario that makes threadring OOM:

1) task calls C using fast_ffi, borrowing a big stack from the scheduler.
2) task returns from C and places the big stack on the task-local stack segment list
3) task calls further Rust functions that require growing the stack, and for this reuses the big stack
4) task yields, failing to return the big stack to the scheduler.
5) repeat 500+ times and OOM

Conflicts:
	src/rt/rust_task.cpp
bors added a commit that referenced this pull request Jun 27, 2013
... through yields

This avoids the following pathological scenario that makes threadring OOM:

1) task calls C using fast_ffi, borrowing a big stack from the scheduler.
2) task returns from C and places the big stack on the task-local stack segment list
3) task calls further Rust functions that require growing the stack, and for this reuses the big stack
4) task yields, failing to return the big stack to the scheduler.
5) repeat 500+ times and OOM

(reopening after incoming fallout. *do not r+*. broken)
@bors bors closed this Jun 27, 2013
@bors bors merged commit 8918461 into rust-lang:master Jun 27, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 22, 2021
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