]> git.lizzy.rs Git - rust.git/commit
rt: Release big stacks immediately after use to avoid holding on to them through...
authorBrian Anderson <banderson@mozilla.com>
Sat, 18 May 2013 00:46:01 +0000 (17:46 -0700)
committerBrian Anderson <banderson@mozilla.com>
Wed, 26 Jun 2013 22:18:36 +0000 (15:18 -0700)
commit8918461fc41576664719c12ce7d655aaad2c78d1
tree6c922dababfdb6562b503421dfc4639962b68faf
parente9ac7194ff31792e2eca2c745fbef309a2daba86
rt: Release big stacks immediately after use to avoid holding on to them 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
src/rt/rust_sched_loop.h
src/rt/rust_task.cpp
src/rt/rust_task.h
src/test/bench/shootout-threadring.rs