Skip to content

Commit 2793b2a

Browse files
committed
Bookkeeping for w2r tasks
We should track w2r tasks. There may be cases where an eviction is started but no pushout to the host happens afterwards before tear-down, e.g., if the data produced in a kernel is sent to another process. The tear-down will then find data in inconsistent state. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
1 parent 0c9b1a0 commit 2793b2a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

parsec/mca/device/transfer_gpu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ parsec_gpu_create_w2r_task(parsec_device_gpu_module_t *gpu_device,
303303
w2r_task->stage_out = &parsec_default_gpu_stage_out;
304304
w2r_task->complete_stage = NULL;
305305

306+
parsec_atomic_fetch_inc_int32( &(gpu_device->mutex) );
307+
306308
(void)es;
307309
return w2r_task;
308310
}
@@ -359,5 +361,6 @@ int parsec_gpu_complete_w2r_task(parsec_device_gpu_module_t *gpu_device,
359361
parsec_thread_mempool_free(es->context_mempool, task);
360362
free(gpu_task);
361363
gpu_device->data_avail_epoch++;
364+
parsec_atomic_fetch_dec_int32( &(gpu_device->mutex) );
362365
return 0;
363366
}

0 commit comments

Comments
 (0)