-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Harden JIT job control against cctors deadlocking. #7423
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
Conversation
…hread is running a cctor. This eliminates a possible source of deadlocks found during AOT runs of Roslyn.
…imply deadlock in case of execution dependency bugs.
mono/mini/mini-runtime.c
Outdated
| //Dependency management is too compilated and we want to get rid of this anyways. | ||
|
|
||
| //We can't suspend the current thread if it's running a protected block (such as a cctor) | ||
| //We can't relie only on JIT nesting as cctor's can be run from outside the JIT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relie -> rely
mono/mini/mini-runtime.c
Outdated
| //We can't suspend the current thread if it's running a protected block (such as a cctor) | ||
| //We can't relie only on JIT nesting as cctor's can be run from outside the JIT. | ||
|
|
||
| //Finally, he hit a timeout or spurious wakeup. We're better of just giving up and keep recompiling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of => off
|
Fixed spelling. |
| g_assert (entry->has_cond); | ||
| mono_coop_cond_wait (&entry->cond, &compilation_data.lock); | ||
| mono_coop_cond_timedwait (&entry->cond, &compilation_data.lock, MAX_JIT_TIMEOUT_MS); | ||
| --entry->threads_waiting; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this going to mask bugs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will.
OTH, it ensures progress can be made even if slow enough. Do you think it's not worth it?
|
@monojenkins build Windows x64 |
|
@monojenkins build Windows i386 |
|
@monojenkins build OS X x64 |
|
@monojenkins build Linux x64 Acceptance Tests |
|
@monojenkins build Linux AArch64 |
|
@marek-safar I am not sure we wanted to merge it 😉 @kumpera can you confirm if we should revert or keep it? |
|
I think me and Zoltan were undecided on whether use a timeout and ensure progress or keep it invite and make bugs evident. Merging this is fine. In case we decide of the later, I'll do a followup PR. |
|
@vargaz what do you think? |
|
I didn't like the timeout, but its fine. |
|
@monojenkins backport 2018-02 |
* [mini] Don't wait for other threads to finish JITing if the current thread is running a cctor. This eliminates a possible source of deadlocks found during AOT runs of Roslyn. * [mini] Introduce a 1s timeout to JIT job control to ensure we don't simply deadlock in case of execution dependency bugs. * [mini] fix spelling5DD
…1730-blindfix Harden JIT job control against cctors deadlocking. (mono#7423)
* [mini] Don't wait for other threads to finish JITing if the current thread is running a cctor. This eliminates a possible source of deadlocks found during AOT runs of Roslyn. * [mini] Introduce a 1s timeout to JIT job control to ensure we don't simply deadlock in case of execution dependency bugs. * [mini] fix spelling5DD
…1730-blindfix Harden JIT job control against cctors deadlocking. (mono#7423)
* [mini] Don't wait for other threads to finish JITing if the current thread is running a cctor. This eliminates a possible source of deadlocks found during AOT runs of Roslyn. * [mini] Introduce a 1s timeout to JIT job control to ensure we don't simply deadlock in case of execution dependency bugs. * [mini] fix spelling5DD Commit migrated from mono/mono@74daf13
No description provided.