소스 검색

prefetch: fix case of a prefetch being evicted

Samuel Thibault 5 년 전
부모
커밋
6110fac0c2
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/datawizard/coherency.c

+ 4 - 2
src/datawizard/coherency.c

@@ -1259,8 +1259,10 @@ void _starpu_fetch_task_input_tail(struct starpu_task *task, struct _starpu_job
 				/* Allocations or transfer prefetchs should have been done by now and marked
 				 * this mc as needed for us.
 				 * Now that we added a reference for the task, we can relieve that.  */
-				STARPU_ASSERT(local_replicate->mc->nb_tasks_prefetch > 0);
-				local_replicate->mc->nb_tasks_prefetch--;
+				/* Note: the replicate might have been evicted in between, thus not 100% sure
+				 * that our prefetch request is still recorded here.  */
+				if (local_replicate->mc->nb_tasks_prefetch > 0)
+					local_replicate->mc->nb_tasks_prefetch--;
 			}
 		}
 		_starpu_spin_unlock(&handle->header_lock);