-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A race to thread_call_enter1() could deadlock
If multiple concurrent deep-stack allocation requests race to vmem_alloc(), the "winner" of the race could be cancelled by one of the other racers, and so the cancelled "winner" would never see the done flag, and would spend the rest of eternity stuck in a cv_wait() loop, hanging the thread that wanted memory. This commit uses a per-arena busy flag to block the later racers from reaching thread_call_enter1() until the race-winner's in-worker-thread memory allocation is complete. Additionally, the worker does less work updating stats, and only takes a mutex around the cv_signal(). The parent also checks for lost and duplicate cv_signals() error conditions.
- Loading branch information
Showing
2 changed files
with
111 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters