summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-04-12 23:18:32 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-04-12 23:18:32 -0400
commitdfacda3b8b51e9d0207ddcf6f4c8f9e2f231d4f7 (patch)
treeb89ec2ee30852a281c4d22d024f50d496e7fd4b0
parent752ef77c1a70372bd2d2f7b349e2e25ac741c0c6 (diff)
Access WSSs with interrupts disabled
-rw-r--r--bin/pm_task.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/pm_task.c b/bin/pm_task.c
index 40f3fb9..71d5690 100644
--- a/bin/pm_task.c
+++ b/bin/pm_task.c
@@ -107,6 +107,7 @@ int main(int argc, char **argv)
107 saved_ctrl_page_ptr = ctrl; 107 saved_ctrl_page_ptr = ctrl;
108#endif 108#endif
109 109
110 iopl(3);
110 /* Enter loop that measures preemption and migration costs. */ 111 /* Enter loop that measures preemption and migration costs. */
111 while (curr_job_count * task_period < SIMRUNTIME) { 112 while (curr_job_count * task_period < SIMRUNTIME) {
112#ifdef DEBUG 113#ifdef DEBUG
@@ -119,6 +120,9 @@ int main(int argc, char **argv)
119#endif 120#endif
120 if (curr_job_count != ctrl->job_count) { 121 if (curr_job_count != ctrl->job_count) {
121 122
123 /* G-EDF with np sections while reading our samples */
124 cli();
125
122 /* ok, this is a new job. Get info from kernel */ 126 /* ok, this is a new job. Get info from kernel */
123 127
124 curr_job_count = ctrl->job_count; 128 curr_job_count = ctrl->job_count;
@@ -208,10 +212,21 @@ int main(int argc, char **argv)
208 data_count = (data_count+1) % DATAPOINTS; 212 data_count = (data_count+1) % DATAPOINTS;
209 } 213 }
210 214
215 /* C, H, H, now exit the NP section
216 * FIXME this is a very long np section, we may think
217 * about splitting it in two: C + H,H
218 */
219 sti();
220
211 } else if (mem_ptr && mem_ptr_end && 221 } else if (mem_ptr && mem_ptr_end &&
212 (curr_sched_count != ctrl->sched_count || 222 (curr_sched_count != ctrl->sched_count ||
213 curr_cpu != ctrl->cpu)) { 223 curr_cpu != ctrl->cpu)) {
214 224
225 /* we are after a preemption / migration:
226 * enter NP before reading
227 */
228 cli();
229
215 /* we have done at least one go in the "best case". 230 /* we have done at least one go in the "best case".
216 * job is the same => preempted / migrated 231 * job is the same => preempted / migrated
217 */ 232 */
@@ -244,6 +259,9 @@ int main(int argc, char **argv)
244 /* okay */ 259 /* okay */
245 data_points[data_count].access_type = 'P'; 260 data_points[data_count].access_type = 'P';
246 261
262 /* exit NP now */
263 sti();
264
247 data_points[data_count].access_time = 265 data_points[data_count].access_time =
248 end_time - start_time; 266 end_time - start_time;
249 data_points[data_count].cpu = curr_cpu; 267 data_points[data_count].cpu = curr_cpu;