-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Fix deadlock in ProgramManager class #2131
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
Merged
bader
merged 10 commits into
intel:sycl
from
dm-vodopyanov:private/dvodopya/fix-deadlock-caused-by-condition-variables-usage
Jul 28, 2020
Merged
[SYCL] Fix deadlock in ProgramManager class #2131
bader
merged 10 commits into
intel:sycl
from
dm-vodopyanov:private/dvodopya/fix-deadlock-caused-by-condition-variables-usage
Jul 28, 2020
Conversation
This file contains hidden or 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 patch fixes deadlock in sycl::detail::ProgramManager class caused by data race in usage of KernelProgramCache::MBuildCV condition variable. Even if BuildResult->State.load() is atomic, it must be modified under the mutex. The deadlock happends in situation when notification notify_all() is sent while MBuildCV is in the wait expression BUT not in the waiting state. The result is - the notification is lost. After that the thread goes to the waiting state and sleeps forever. BuildResult is protected by mutex now, so the notification will be sent only when the other thread in the waiting state.
s-kanaev
reviewed
Jul 18, 2020
kbobrovs
reviewed
Jul 20, 2020
Signed-off-by: Dmitry Vodopyanov <[email protected]>
s-kanaev
reviewed
Jul 23, 2020
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.
Looks good overall.
Though, a couple of comments to be resolved one way or the other.
kbobrovs
previously approved these changes
Jul 27, 2020
…ition-variables-usage
Signed-off-by: Sergey Kanaev <[email protected]>
Signed-off-by: Sergey Kanaev <[email protected]>
Signed-off-by: Sergey Kanaev <[email protected]>
Signed-off-by: Sergey Kanaev <[email protected]>
Signed-off-by: Sergey Kanaev <[email protected]>
/summary:run |
rbegam
approved these changes
Jul 27, 2020
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.
LGTM
kbobrovs
approved these changes
Jul 28, 2020
jsji
pushed a commit
that referenced
this pull request
Aug 31, 2023
This is a bulk conversion done using the migration script. There are more extension tests to be converted; however they will need manual fixups, so leave them out of this bulk conversion. Original commit: KhronosGroup/SPIRV-LLVM-Translator@e6eae86
Chenyang-L
pushed a commit
that referenced
this pull request
Feb 18, 2025
[EXP][CMDBUF] Make command handle behaviour consistent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch fixes deadlock in
sycl::detail::ProgramManager
class caused by data race in usage ofKernelProgramCache::MBuildCV
condition variable.Even if
BuildResult->State.load()
is atomic, it must be modified under the mutex. The deadlock happens in situation when notificationnotify_all()
is sent whileMBuildCV
is in the wait expression BUT not in the waiting state. The result is - the notification is lost. After that the thread goes to the waiting state and sleeps forever.BuildResult
is protected by mutex now, so the notification will be sent only when the other thread in the waiting state.