Skip to content

Fix race between two concurrent critnib_remove() calls - #1383

Closed
ldorau wants to merge 1 commit into
oneapi-src:mainfrom
ldorau:Fix_race_between_two_concurrent_critnib_remove_calls
Closed

Fix race between two concurrent critnib_remove() calls#1383
ldorau wants to merge 1 commit into
oneapi-src:mainfrom
ldorau:Fix_race_between_two_concurrent_critnib_remove_calls

Conversation

@ldorau

@ldorau ldorau commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

Description

Fix race between two concurrent critnib_remove() calls.

It fixes a fail like in:
https://github.com/oneapi-src/unified-memory-framework/actions/runs/15815018773/job/44572264620
caused by two concurrent umfMemoryTrackerRemoveIpcSegment() calls.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

@ldorau
ldorau requested a review from a team as a code owner June 23, 2025 09:08
@ldorau
ldorau requested review from bratpiorka and lplewa June 23, 2025 10:16
@ldorau
ldorau force-pushed the Fix_race_between_two_concurrent_critnib_remove_calls branch from b142203 to 76a3c1c Compare June 23, 2025 14:12
Fix race between two concurrent critnib_remove() calls.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
@ldorau
ldorau force-pushed the Fix_race_between_two_concurrent_critnib_remove_calls branch from 76a3c1c to 05bdf0d Compare June 24, 2025 09:57
Comment thread src/critnib/critnib.c Outdated
if (c->cb_free_leaf && value) {
void *expected = value;
void *desired = NULL;
if (utils_compare_exchange_u64((uint64_t *)&k->value,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add ptr version of utils_compare_exchange (note: there is special function on windows for it)

@ldorau
ldorau marked this pull request as draft June 24, 2025 10:49
@ldorau ldorau closed this Jun 24, 2025
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.

2 participants