Skip to content

Conversation

@uditagarwal97
Copy link
Contributor

@uditagarwal97 uditagarwal97 commented Nov 20, 2025

Deadlock can happen if L0 calls exit() while we are in the middle of enqueuing a command.

@uditagarwal97 uditagarwal97 self-assigned this Nov 20, 2025
@uditagarwal97 uditagarwal97 marked this pull request as ready for review November 20, 2025 18:48
@uditagarwal97 uditagarwal97 requested a review from a team as a code owner November 20, 2025 18:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a deadlock issue that can occur during application shutdown when Level Zero (L0) calls exit() while command enqueue operations are in progress. The fix introduces checks using GlobalHandler::instance().isOkToDefer() to avoid strict lock acquisition during shutdown scenarios.

  • Adds shutdown-aware checks before attempting host memory updates
  • Modifies removeMemoryObject call to accept a parameter indicating whether strict locking is required
  • Updates assertion logic to account for potential failures during shutdown

Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

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

LGTM
would be nice to fix comments as Copilot's suggested.

@uditagarwal97 uditagarwal97 merged commit 7bdfb08 into sycl Nov 24, 2025
30 of 32 checks passed
@uditagarwal97 uditagarwal97 deleted the private/udit/sycl_shutdown branch November 24, 2025 16:26
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.

3 participants