Skip to content

Commit

Permalink
Prevent race condition in accelerator copies management
Browse files Browse the repository at this point in the history
Prevent the owner device from repurposing a GPU copy while another GPU
is planning to use it as a candidate for a d2d transfer.

Signed-off-by: George Bosilca <[email protected]>
  • Loading branch information
bosilca committed Oct 18, 2023
1 parent ac4799d commit f69460c
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 84 deletions.
6 changes: 2 additions & 4 deletions parsec/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ int parsec_data_start_transfer_ownership_to_copy(parsec_data_t* data,

copy = data->device_copies[device];
assert( NULL != copy );

PARSEC_DEBUG_VERBOSE(10, parsec_debug_output,
"DEV[%d]: start transfer ownership of data %p to copy %p in mode %d",
device, data, copy, access_mode);

switch( copy->coherency_state ) {
case PARSEC_DATA_COHERENCY_INVALID:
transfer_required = 1;
Expand Down Expand Up @@ -415,8 +415,6 @@ int parsec_data_start_transfer_ownership_to_copy(parsec_data_t* data,
}
}

assert( (!transfer_required) || (data->device_copies[valid_copy]->version >= copy->version) );

if( PARSEC_FLOW_ACCESS_READ & access_mode ) {
copy->readers++;
}
Expand Down
Loading

0 comments on commit f69460c

Please sign in to comment.