瀏覽代碼

Fix reusing relaxed-memory memchunks

Samuel Thibault 6 年之前
父節點
當前提交
17edf42307
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      src/datawizard/memalloc.c

+ 11 - 1
src/datawizard/memalloc.c

@@ -530,7 +530,17 @@ static size_t try_to_throw_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node
 			 * to update the status in terms of MSI protocol
 			 * because this memchunk is associated to a replicate
 			 * in "relaxed coherency" mode. */
-			freed = do_free_mem_chunk(mc, node);
+			if (replicate)
+			{
+				/* Reuse for this replicate */
+				reuse_mem_chunk(node, replicate, mc, is_already_in_mc_list);
+				freed = 1;
+			}
+			else
+			{
+				/* Free */
+				freed = do_free_mem_chunk(mc, node);
+			}
 		}
 
 		_starpu_spin_unlock(&handle->header_lock);