Skip to content

Fix l0 teardown and sycl windows teardown #17869

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

Conversation

nrspruit
Copy link
Contributor

@nrspruit nrspruit commented Apr 4, 2025

No description provided.

cperkinsintel and others added 18 commits February 21, 2025 11:53
…design/GlobalObjectsInRuntime.md for a full technical description
Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
Signed-off-by: Neil R. Spruit <[email protected]>
@cperkinsintel cperkinsintel marked this pull request as ready for review April 16, 2025 03:50
@cperkinsintel cperkinsintel requested review from a team as code owners April 16, 2025 03:50
Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional documentation on shutdown behavior topic is very useful.

@cperkinsintel
Copy link
Contributor

We are seeing this unrelated Jenkins/Precommit failure in other PR. (e.g. #18014 ) .

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly small comments, but overall I think it looks good. Sorry for the delay!

Comment on lines +312 to +318
if (!Lock.owns_lock()) {

if (allowWait)
return false; // Record was not removed, the caller may try again.
else
return true; // skip.
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit;

Suggested change
if (!Lock.owns_lock()) {
if (allowWait)
return false; // Record was not removed, the caller may try again.
else
return true; // skip.
}
// If we fail to acquire the lock, return false if the record is still there
// and the caller can try again. Return true if the record is gone and
// the caller should skip.
if (!Lock.owns_lock())
return !allowWait;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have said this is only a "nit" I'd like to keep it as is, as I think it is easier to read and see the logic as it's written now. Returning !allowWait is definitely an abbreviation, but it doesn't tie into the comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I don't think allowWait has any clear ties either way. In general, if (X) return false else return true is a bit of a logics anti-pattern. You can leave it, but as an outside reader, I think they convey the information equally well. You can also reword the comment if you can think of a better way of explaining it.

@uditagarwal97 uditagarwal97 merged commit 5261637 into intel:sycl Apr 24, 2025
39 of 40 checks passed
steffenlarsen added a commit to steffenlarsen/llvm that referenced this pull request Jun 19, 2025
After intel#17869, Windows will not unload
images during the runtime of the program. However, this means that
shared libraries that are dynamically loaded and unloaded will leave
dangling pointers to their images. If somehow these images get picked
up, e.g. if another library is loaded with overlapping symbols, the
runtime may try to dereference the dangling device image pointers. This
commit reenables Windows unloading with the caveat that once the global
handler is dead the runtime assumes that shutdown has begun.

Signed-off-by: Larsen, Steffen <[email protected]>
steffenlarsen added a commit to steffenlarsen/llvm that referenced this pull request Jun 19, 2025
After intel#17869, Windows will not unload
images during the runtime of the program. However, this means that
shared libraries that are dynamically loaded and unloaded will leave
dangling pointers to their images. If somehow these images get picked
up, e.g. if another library is loaded with overlapping symbols, the
runtime may try to dereference the dangling device image pointers. This
commit reenables Windows unloading with the caveat that once the global
handler is dead the runtime assumes that shutdown has begun.

Signed-off-by: Larsen, Steffen <[email protected]>
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.

6 participants