aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/dgl.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-10-24 16:20:17 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-10-24 16:20:17 -0400
commit97f6b3f52bc3059f6e5fb7c6744d6384b4fca95d (patch)
tree7673ef7e3d8f9137d1adcf742c1501eb06a5083c /litmus/dgl.c
parent98cda4763a6f0bab8cb636447787e36ad3ea3d26 (diff)
Moved some requeueing work out of CPU locks.
Diffstat (limited to 'litmus/dgl.c')
-rw-r--r--litmus/dgl.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/litmus/dgl.c b/litmus/dgl.c
index f6580a9234dc..d8d686b6f334 100644
--- a/litmus/dgl.c
+++ b/litmus/dgl.c
@@ -497,7 +497,6 @@ static void will_acquire_to_acquire(struct dgl *dgl, struct dgl_group_req *greq)
497 add_acquired(dgl, &resource->acquired, our_req); 497 add_acquired(dgl, &resource->acquired, our_req);
498 498
499 resource->real_free -= our_req->replicas; 499 resource->real_free -= our_req->replicas;
500
501 BUG_DUMP(dgl, (resource->real_free < 0)); 500 BUG_DUMP(dgl, (resource->real_free < 0));
502 } 501 }
503} 502}
@@ -516,8 +515,10 @@ static void pull_blocked(struct dgl *dgl, struct dgl_resource *resource)
516 take_cpu(dgl, greq); 515 take_cpu(dgl, greq);
517 will_acquire_to_acquire(dgl, greq); 516 will_acquire_to_acquire(dgl, greq);
518 dgl->cpu_acquired(greq); 517 dgl->cpu_acquired(greq);
518 update_blocked(dgl, resource);
519 } 519 }
520 } 520 }
521
521} 522}
522 523
523/* 524/*
@@ -642,6 +643,7 @@ static void pull_prio(struct dgl *dgl, struct dgl_resource *resource)
642 } else { 643 } else {
643 waiting_to_will_acquire(dgl, greq); 644 waiting_to_will_acquire(dgl, greq);
644 } 645 }
646 update_prio(dgl, resource);
645 } 647 }
646 } 648 }
647} 649}
@@ -734,6 +736,10 @@ void remove_group_req(struct dgl *dgl, struct dgl_group_req *greq)
734 running = dgl->acquired[greq->cpu] == greq; 736 running = dgl->acquired[greq->cpu] == greq;
735 has_prio = !arr_to_bool(dgl, greq->need_prio); 737 has_prio = !arr_to_bool(dgl, greq->need_prio);
736 738
739 if (dgl->acquired[greq->cpu] == greq) {
740 release_cpu(dgl, greq);
741 }
742
737 for_each_resource(greq->requested, dgl, w, b, i) { 743 for_each_resource(greq->requested, dgl, w, b, i) {
738 our_req = &greq->requests[i]; 744 our_req = &greq->requests[i];
739 resource = &dgl->resources[i]; 745 resource = &dgl->resources[i];
@@ -741,33 +747,31 @@ void remove_group_req(struct dgl *dgl, struct dgl_group_req *greq)
741 if (running) { 747 if (running) {
742 resource->real_free += our_req->replicas; 748 resource->real_free += our_req->replicas;
743 BUG_DUMP(dgl, resource->real_free > dgl->num_replicas); 749 BUG_DUMP(dgl, resource->real_free > dgl->num_replicas);
750 update_blocked(dgl, resource);
744 } 751 }
745 if (has_prio) { 752 if (has_prio) {
746 resource->goal_free += our_req->replicas; 753 resource->goal_free += our_req->replicas;
747 BUG_DUMP(dgl, resource->goal_free > dgl->num_replicas); 754 BUG_DUMP(dgl, resource->goal_free > dgl->num_replicas);
755 update_prio(dgl, resource);
748 } 756 }
749 757
750 list_del_init(&our_req->list); 758 list_del_init(&our_req->list);
751 } 759 }
752 760
753 if (dgl->acquired[greq->cpu] == greq) { 761 /* if (!arr_to_bool(dgl, greq->need_prio)) { */
754 release_cpu(dgl, greq); 762 /* for_each_resource(greq->requested, dgl, w, b, i) { */
755 } 763 /* update_prio(dgl, &dgl->resources[i]); */
756 764 /* } */
757 if (!arr_to_bool(dgl, greq->need_prio)) { 765 /* for_each_resource(greq->requested, dgl, w, b, i) { */
758 for_each_resource(greq->requested, dgl, w, b, i) { 766 /* pull_prio(dgl, &dgl->resources[i]); */
759 update_prio(dgl, &dgl->resources[i]); 767 /* } */
760 } 768 /* } */
761 for_each_resource(greq->requested, dgl, w, b, i) { 769
762 pull_prio(dgl, &dgl->resources[i]); 770 /* for_each_resource(greq->requested, dgl, w, b, i) { */
763 } 771 /* resource = &dgl->resources[i]; */
764 } 772 /* if (running) update_blocked(dgl, resource); */
765 773 /* if (has_prio) update_prio(dgl, resource); */
766 for_each_resource(greq->requested, dgl, w, b, i) { 774 /* } */
767 resource = &dgl->resources[i];
768 if (running) update_blocked(dgl, resource);
769 if (has_prio) update_prio(dgl, resource);
770 }
771 for_each_resource(greq->requested, dgl, w, b, i) { 775 for_each_resource(greq->requested, dgl, w, b, i) {
772 resource = &dgl->resources[i]; 776 resource = &dgl->resources[i];
773 if (running) pull_blocked(dgl, resource); 777 if (running) pull_blocked(dgl, resource);