|
@@ -1529,9 +1529,19 @@ static starpu_ssize_t _starpu_allocate_interface(starpu_data_handle_t handle, st
|
|
|
}
|
|
|
reclaim -= freed;
|
|
|
|
|
|
+ if (is_prefetch)
|
|
|
+ {
|
|
|
+ /* It's just prefetch, don't bother existing allocations */
|
|
|
+ /* And don't bother tracing allocation attempts */
|
|
|
+ prefetch_out_of_memory[dst_node] = 1;
|
|
|
+ /* TODO: ideally we should not even try to allocate when we know we have not freed anything */
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
/* Try to reuse an allocated data with the same interface (to avoid spurious free/alloc) */
|
|
|
if (_starpu_has_not_important_data && try_to_reuse_not_important_mc(dst_node, handle, replicate, footprint, is_prefetch))
|
|
|
break;
|
|
|
+
|
|
|
if (try_to_reuse_potentially_in_use_mc(dst_node, handle, replicate, footprint, is_prefetch))
|
|
|
{
|
|
|
reused = 1;
|
|
@@ -1539,15 +1549,6 @@ static starpu_ssize_t _starpu_allocate_interface(starpu_data_handle_t handle, st
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if (is_prefetch)
|
|
|
- {
|
|
|
- /* It's just prefetch, don't bother existing allocations */
|
|
|
- /* And don't bother tracing allocation attempts */
|
|
|
- prefetch_out_of_memory[dst_node] = 1;
|
|
|
- /* TODO: ideally we should not even try to allocate when we know we have not freed anything */
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
if (!told_reclaiming)
|
|
|
{
|
|
|
/* Prevent prefetches and such from happening */
|