diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-04-23 12:12:58 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-04-23 12:12:58 -0400 |
commit | fa43d7a6bb9b0e748f23529424ac5eebd849d9d7 (patch) | |
tree | 549863d378476e608f264315f3fbb77dcd21cbd5 | |
parent | 372db158e2a5c7e2b455262c0959eb13da4433b9 (diff) |
Donees cannot be amongst the top-m requests.
-rw-r--r-- | litmus/ikglp_lock.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/litmus/ikglp_lock.c b/litmus/ikglp_lock.c index 1ce6572eddcb..1a5d674b26a5 100644 --- a/litmus/ikglp_lock.c +++ b/litmus/ikglp_lock.c | |||
@@ -1957,8 +1957,11 @@ static ikglp_donee_heap_node_t* pick_donee(struct ikglp_affinity* aff, | |||
1957 | struct ikglp_semaphore *sem = ikglp_from_lock(aff->obs.lock); | 1957 | struct ikglp_semaphore *sem = ikglp_from_lock(aff->obs.lock); |
1958 | struct task_struct *donee; | 1958 | struct task_struct *donee; |
1959 | ikglp_donee_heap_node_t *donee_node; | 1959 | ikglp_donee_heap_node_t *donee_node; |
1960 | struct task_struct *mth_highest = ikglp_mth_highest(sem); | ||
1960 | 1961 | ||
1961 | if(fq->owner && fq->donee_heap_node.donor_info != NULL) { | 1962 | if(fq->owner && |
1963 | fq->donee_heap_node.donor_info != NULL && | ||
1964 | litmus->__compare(mth_highest, BASE, fq->owner, BASE)) { | ||
1962 | donee = fq->owner; | 1965 | donee = fq->owner; |
1963 | donee_node = &(fq->donee_heap_node); | 1966 | donee_node = &(fq->donee_heap_node); |
1964 | *dist_from_head = 0; | 1967 | *dist_from_head = 0; |
@@ -1979,8 +1982,9 @@ static ikglp_donee_heap_node_t* pick_donee(struct ikglp_affinity* aff, | |||
1979 | // the donee will be closer to obtaining a resource. | 1982 | // the donee will be closer to obtaining a resource. |
1980 | list_for_each(pos, &fq->wait.task_list) { | 1983 | list_for_each(pos, &fq->wait.task_list) { |
1981 | wait_queue_t *fq_wait = list_entry(pos, wait_queue_t, task_list); | 1984 | wait_queue_t *fq_wait = list_entry(pos, wait_queue_t, task_list); |
1982 | if(!has_donor(fq_wait)) { | 1985 | ikglp_wait_state_t *wait = container_of(fq_wait, ikglp_wait_state_t, fq_node); |
1983 | ikglp_wait_state_t *wait = container_of(fq_wait, ikglp_wait_state_t, fq_node); | 1986 | if(!has_donor(fq_wait) && |
1987 | litmus->__compare(mth_highest, BASE, wait->task, BASE)) { | ||
1984 | donee = (struct task_struct*) fq_wait->private; | 1988 | donee = (struct task_struct*) fq_wait->private; |
1985 | donee_node = &wait->donee_heap_node; | 1989 | donee_node = &wait->donee_heap_node; |
1986 | 1990 | ||
@@ -2019,8 +2023,9 @@ ikglp_donee_heap_node_t* gpu_ikglp_advise_donee_selection( | |||
2019 | struct task_struct* donor) | 2023 | struct task_struct* donor) |
2020 | { | 2024 | { |
2021 | // Huristic strategy: Find the highest-priority donee that is waiting on | 2025 | // Huristic strategy: Find the highest-priority donee that is waiting on |
2022 | // a queue closest to our affinity. The donee CANNOT already have a donor | 2026 | // a queue closest to our affinity. (1) The donee CANNOT already have a |
2023 | // (exception: donee is the lowest-prio task in the donee heap). | 2027 | // donor (exception: donee is the lowest-prio task in the donee heap). |
2028 | // (2) Requests in 'top_m' heap are ineligible. | ||
2024 | // | 2029 | // |
2025 | // Further strategy: amongst elible donees waiting for the same GPU, pick | 2030 | // Further strategy: amongst elible donees waiting for the same GPU, pick |
2026 | // the one closest to the head of the FIFO queue (including owners). | 2031 | // the one closest to the head of the FIFO queue (including owners). |
@@ -2058,6 +2063,9 @@ ikglp_donee_heap_node_t* gpu_ikglp_advise_donee_selection( | |||
2058 | donee_node = NULL; | 2063 | donee_node = NULL; |
2059 | distance = MIG_NONE; | 2064 | distance = MIG_NONE; |
2060 | 2065 | ||
2066 | // TODO: The below search logic may work well for locating nodes to steal | ||
2067 | // when an FQ goes idle. Validate this code and apply it to stealing. | ||
2068 | |||
2061 | // begin search with affinity GPU. | 2069 | // begin search with affinity GPU. |
2062 | start = gpu_to_base_replica(aff, tsk_rt(donor)->last_gpu); | 2070 | start = gpu_to_base_replica(aff, tsk_rt(donor)->last_gpu); |
2063 | i = start; | 2071 | i = start; |