From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/tests/threads/mlfqs-load-1.c | 60 ------------------------------ 1 file changed, 60 deletions(-) delete mode 100644 pintos-progos/tests/threads/mlfqs-load-1.c (limited to 'pintos-progos/tests/threads/mlfqs-load-1.c') diff --git a/pintos-progos/tests/threads/mlfqs-load-1.c b/pintos-progos/tests/threads/mlfqs-load-1.c deleted file mode 100644 index a39eea2..0000000 --- a/pintos-progos/tests/threads/mlfqs-load-1.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Verifies that a single busy thread raises the load average to - 0.5 in 38 to 45 seconds. The expected time is 42 seconds, as - you can verify: - perl -e '$i++,$a=(59*$a+1)/60while$a<=.5;print "$i\n"' - - Then, verifies that 10 seconds of inactivity drop the load - average back below 0.5 again. */ - -#include -#include "tests/threads/tests.h" -#include "threads/init.h" -#include "threads/malloc.h" -#include "threads/synch.h" -#include "threads/thread.h" -#include "devices/timer.h" - -void -test_mlfqs_load_1 (void) -{ - int64_t start_time; - int elapsed; - int load_avg; - - ASSERT (thread_mlfqs); - - msg ("spinning for up to 45 seconds, please wait..."); - - start_time = timer_ticks (); - for (;;) - { - load_avg = thread_get_load_avg (); - ASSERT (load_avg >= 0); - elapsed = timer_elapsed (start_time) / TIMER_FREQ; - if (load_avg > 100) - fail ("load average is %d.%02d " - "but should be between 0 and 1 (after %d seconds)", - load_avg / 100, load_avg % 100, elapsed); - else if (load_avg > 50) - break; - else if (elapsed > 45) - fail ("load average stayed below 0.5 for more than 45 seconds"); - } - - if (elapsed < 38) - fail ("load average took only %d seconds to rise above 0.5", elapsed); - msg ("load average rose to 0.5 after %d seconds", elapsed); - - msg ("sleeping for another 10 seconds, please wait..."); - timer_sleep (TIMER_FREQ * 10); - - load_avg = thread_get_load_avg (); - if (load_avg < 0) - fail ("load average fell below 0"); - if (load_avg > 50) - fail ("load average stayed above 0.5 for more than 10 seconds"); - msg ("load average fell back below 0.5 (to %d.%02d)", - load_avg / 100, load_avg % 100); - - pass (); -} -- cgit v1.2.3