aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/blocking
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-05-17 09:41:49 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-05-17 09:41:49 -0400
commitc2e3e08ef2ce90237b7b50efd0adc1e2848a3729 (patch)
tree9574a97377fafda742c6b75a21971a6c909e8394 /native/src/blocking
parent7cd7212e7273c9c137e4bb1825d2b9f3842c882d (diff)
C++: Properly consider priority ceilings in DPCP bound
The bound should not reflect requests executed by agents that can be preempted.
Diffstat (limited to 'native/src/blocking')
-rw-r--r--native/src/blocking/dpcp.cpp22
-rw-r--r--native/src/blocking/mpcp.cpp22
2 files changed, 19 insertions, 25 deletions
diff --git a/native/src/blocking/dpcp.cpp b/native/src/blocking/dpcp.cpp
index 6e194aa..a9b1288 100644
--- a/native/src/blocking/dpcp.cpp
+++ b/native/src/blocking/dpcp.cpp
@@ -65,6 +65,7 @@ static unsigned int count_requests_to_cpu(
65static Interference bound_blocking_dpcp( 65static Interference bound_blocking_dpcp(
66 const TaskInfo* tsk, 66 const TaskInfo* tsk,
67 const ContentionSet& cont, 67 const ContentionSet& cont,
68 const PriorityCeilings& prio_ceiling,
68 unsigned int max_lower_prio) 69 unsigned int max_lower_prio)
69{ 70{
70 Interference inter; 71 Interference inter;
@@ -86,7 +87,8 @@ static Interference bound_blocking_dpcp(
86 inter.count += num; 87 inter.count += num;
87 inter.total_length += num * req->get_request_length(); 88 inter.total_length += num * req->get_request_length();
88 } 89 }
89 else if (max_lower_prio) 90 else if (max_lower_prio &&
91 prio_ceiling[req->get_resource_id()] <= tsk->get_priority())
90 { 92 {
91 // lower prio => only remaining 93 // lower prio => only remaining
92 num = std::min(req->get_max_num_requests(interval), max_lower_prio); 94 num = std::min(req->get_max_num_requests(interval), max_lower_prio);
@@ -103,6 +105,7 @@ static Interference bound_blocking_dpcp(
103static Interference dpcp_remote_bound( 105static Interference dpcp_remote_bound(
104 const TaskInfo& tsk, 106 const TaskInfo& tsk,
105 const ResourceLocality& locality, 107 const ResourceLocality& locality,
108 const PriorityCeilings& prio_ceilings,
106 const AllPerCluster& per_cpu) 109 const AllPerCluster& per_cpu)
107{ 110{
108 Interference blocking; 111 Interference blocking;
@@ -118,7 +121,7 @@ static Interference dpcp_remote_bound(
118 reqs = count_requests_to_cpu(tsk, locality, cpu); 121 reqs = count_requests_to_cpu(tsk, locality, cpu);
119 122
120 if (reqs > 0) 123 if (reqs > 0)
121 blocking += bound_blocking_dpcp(&tsk, cs, reqs); 124 blocking += bound_blocking_dpcp(&tsk, cs, prio_ceilings, reqs);
122 } 125 }
123 cpu++; 126 cpu++;
124 } 127 }
@@ -150,6 +153,17 @@ static Interference dpcp_local_bound(
150} 153}
151 154
152 155
156static PriorityCeilings get_priority_ceilings(const ResourceSharingInfo& info)
157{
158 Resources resources;
159 PriorityCeilings ceilings;
160
161 split_by_resource(info, resources);
162 determine_priority_ceilings(resources, ceilings);
163
164 return ceilings;
165}
166
153BlockingBounds* dpcp_bounds(const ResourceSharingInfo& info, 167BlockingBounds* dpcp_bounds(const ResourceSharingInfo& info,
154 const ResourceLocality& locality) 168 const ResourceLocality& locality)
155{ 169{
@@ -158,6 +172,8 @@ BlockingBounds* dpcp_bounds(const ResourceSharingInfo& info,
158 split_by_locality(info, locality, per_cpu); 172 split_by_locality(info, locality, per_cpu);
159 sort_by_request_length(per_cpu); 173 sort_by_request_length(per_cpu);
160 174
175 PriorityCeilings prio_ceilings = get_priority_ceilings(info);
176
161 BlockingBounds* _results = new BlockingBounds(info); 177 BlockingBounds* _results = new BlockingBounds(info);
162 BlockingBounds& results = *_results; 178 BlockingBounds& results = *_results;
163 179
@@ -166,7 +182,7 @@ BlockingBounds* dpcp_bounds(const ResourceSharingInfo& info,
166 const TaskInfo& tsk = info.get_tasks()[i]; 182 const TaskInfo& tsk = info.get_tasks()[i];
167 Interference remote, local; 183 Interference remote, local;
168 184
169 remote = dpcp_remote_bound(tsk, locality, per_cpu); 185 remote = dpcp_remote_bound(tsk, locality, prio_ceilings, per_cpu);
170 local = dpcp_local_bound(&tsk, per_cpu[tsk.get_cluster()]); 186 local = dpcp_local_bound(&tsk, per_cpu[tsk.get_cluster()]);
171 187
172 results[i] = remote + local; 188 results[i] = remote + local;
diff --git a/native/src/blocking/mpcp.cpp b/native/src/blocking/mpcp.cpp
index 8b87556..655e09e 100644
--- a/native/src/blocking/mpcp.cpp
+++ b/native/src/blocking/mpcp.cpp
@@ -7,28 +7,6 @@
7// *************************** MPCP ****************************************** 7// *************************** MPCP ******************************************
8 8
9 9
10typedef std::vector<unsigned int> PriorityCeilings;
11
12static void determine_priority_ceilings(const Resources& resources,
13 PriorityCeilings& ceilings)
14{
15 ceilings.reserve(resources.size());
16
17 foreach(resources, it)
18 {
19 unsigned int ceiling = UINT_MAX;
20 const ContentionSet& cs = *it;
21
22 foreach(cs, jt)
23 {
24 const RequestBound* req = *jt;
25 ceiling = std::min(ceiling, req->get_task()->get_priority());
26 }
27
28 ceilings.push_back(ceiling);
29 }
30}
31
32typedef std::vector<unsigned long> ResponseTimes; 10typedef std::vector<unsigned long> ResponseTimes;
33typedef std::vector<ResponseTimes> TaskResponseTimes; 11typedef std::vector<ResponseTimes> TaskResponseTimes;
34typedef std::vector<TaskResponseTimes> ClusterResponseTimes; 12typedef std::vector<TaskResponseTimes> ClusterResponseTimes;