From c15690f54d895a077f8ade239c8c43f06f6bb549 Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Mon, 20 Jul 2026 18:20:12 -0400 Subject: [PATCH] Don't singleton batched tasks rings before executing them If the task returns PARSEC_HOOK_RETURN_AGAIN, we must not break the ring and instead hand it back to the execution step. Signed-off-by: Joseph Schuchart --- parsec/mca/device/device_gpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/parsec/mca/device/device_gpu.c b/parsec/mca/device/device_gpu.c index 67e7ca6c3..599c2965f 100644 --- a/parsec/mca/device/device_gpu.c +++ b/parsec/mca/device/device_gpu.c @@ -2918,8 +2918,13 @@ parsec_device_kernel_exec( parsec_device_gpu_module_t *gpu_device, /* The submit hook may turn gpu_task into a batch ring. Start from a clean * singleton so stale list links left by release-mode list operations cannot * be mistaken for a preexisting ring. + * However, if the task returned PARSEC_HOOK_RETURN_AGAIN, we must preserve the + * ring as it may contain the follower tasks of the batch. */ - PARSEC_LIST_ITEM_SINGLETON(&gpu_task->list_item); + if (gpu_task->last_status != PARSEC_HOOK_RETURN_AGAIN) { + /* The task is being rescheduled, we need to reset the status */ + PARSEC_LIST_ITEM_SINGLETON(&gpu_task->list_item); + } (void)this_task; rc = progress_fct( gpu_device, gpu_task, gpu_stream );