Browse Source

port r18366 from 1.2: fix loop...
fix request priority

Samuel Thibault 9 years ago
parent
commit
4558b08a5b
2 changed files with 10 additions and 7 deletions
  1. 3 0
      src/datawizard/coherency.c
  2. 7 7
      src/datawizard/memalloc.c

+ 3 - 0
src/datawizard/coherency.c

@@ -678,6 +678,9 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 				if (r2)
 				{
 					_starpu_spin_lock(&r2->lock);
+					if (is_prefetch < r2->prefetch)
+						/* Hasten the request we will have to wait for */
+						_starpu_update_prefetch_status(r2, is_prefetch);
 					r2->next_req[r2->next_req_count++] = r;
 					STARPU_ASSERT(r2->next_req_count <= STARPU_MAXNODES + 1);
 					_starpu_spin_unlock(&r2->lock);

+ 7 - 7
src/datawizard/memalloc.c

@@ -1008,14 +1008,14 @@ void starpu_memchunk_tidy(unsigned node)
 			{
 				unsigned n;
 				for (n = 0; n < STARPU_MAXNODES; n++)
-				{
 					if (_starpu_get_data_refcnt(handle, n))
-					{
-						/* Some task is writing to the handle somewhere */
-						_starpu_spin_unlock(&handle->header_lock);
-						skipped = 1;
-						continue;
-					}
+						break;
+				if (n < STARPU_MAXNODES)
+				{
+					/* Some task is writing to the handle somewhere */
+					_starpu_spin_unlock(&handle->header_lock);
+					skipped = 1;
+					continue;
 				}
 			}