Browse Source

Revert "data_request: Fix adding reference when the request will actually be already complete"

This reverts commit 402d74b121fbdae08bfb44490a4bf21189f7ebc9.
Samuel Thibault 4 years ago
parent
commit
98c19dbce0
2 changed files with 6 additions and 6 deletions
  1. 6 0
      src/datawizard/copy_driver.c
  2. 0 6
      src/datawizard/data_request.c

+ 6 - 0
src/datawizard/copy_driver.c

@@ -211,6 +211,12 @@ int STARPU_ATTRIBUTE_WARN_UNUSED_RESULT _starpu_driver_copy_data_1_to_1(starpu_d
 		STARPU_ASSERT(src_replicate->refcnt);
 	}
 
+	/* For prefetches, we take a reference on the destination only now that
+	 * we will really try to fetch the data (instead of in
+	 * _starpu_create_data_request) */
+	if (req->prefetch > STARPU_FETCH)
+		dst_replicate->refcnt++;
+
 	unsigned src_node = src_replicate->memory_node;
 	unsigned dst_node = dst_replicate->memory_node;
 

+ 0 - 6
src/datawizard/data_request.c

@@ -531,12 +531,6 @@ static int starpu_handle_data_request(struct _starpu_data_request *r, unsigned m
 	STARPU_ASSERT(!(r_mode & STARPU_R) || src_replicate->allocated);
 	STARPU_ASSERT(!(r_mode & STARPU_R) || src_replicate->refcnt);
 
-	/* For prefetches, we take a reference on the destination only now that
-	 * we will really try to fetch the data (instead of in
-	 * _starpu_create_data_request) */
-	if (r->prefetch > STARPU_FETCH)
-		dst_replicate->refcnt++;
-
 	_starpu_spin_unlock(&r->lock);
 
 	/* FIXME: the request may get upgraded from here to freeing it... */