Skip to content

[XPTI][INFRA] Fixes race issues with Emhash under contention #19600

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
merged 4 commits into from
Jul 25, 2025

Conversation

tovinkere
Copy link
Contributor

  • Under severe concurrent access, rehash in Emhash was being called during insert and this is documented as a problem in Emhash Readme. Rehash for the Emhash containers will not have to be called now as enough space for handling streams is reserved.
  • xptiCheckTraceEnabled() is now thread-safe
  • Emhash containers now have sizes reserved to accommodate the entries and all second level hash maps that were Emhash in the past have been replaced with parallel hashmap.

- xptiCheckTraceEnabled() is now thread-safe
- Emash can have issues when rehash is called during
  insertion. So, all Emhash containers now have sizes
  reserved to accommodate the entries and all second
  level hash maps use parallel hashmap.
- Under severe concurrent access, rehash in Emhash
  was being called during insert. Rehash for the Emhash
  containers will not have to be called now.

Signed-off-by: Vasanth Tovinkere <[email protected]>
@tovinkere tovinkere requested a review from a team as a code owner July 25, 2025 21:31
@aelovikov-intel aelovikov-intel requested a review from sarnex July 25, 2025 21:36
Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

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

Looks reasonable, but I'm not familiar with the code. @KseniyaTikhomirova , FYI, maybe for a post-commit review?

@@ -1562,12 +1565,14 @@ class Notifications {
}
}
#endif
{
std::unique_lock<std::shared_mutex> Lock(MFlagsLock);
auto &TraceFlags = MStreamFlags[StreamID]; // Get the trace flags for the
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment here ends abruptly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated it!

Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

lgtm from dependency pov, parallel hashmap is already a dep so this isnt changing anything. not qualified to review for correctness

@aelovikov-intel
Copy link
Contributor

Fail seems to be covered by #15207.

@aelovikov-intel aelovikov-intel merged commit dde5462 into intel:sycl Jul 25, 2025
38 of 40 checks passed
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

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.

4 participants