Add hints about not doing too much work in timer interrupt.
[pintos-anon] / src / tests / threads / mlfqs-load-avg.c
index 1462a80eb3c9594d269f239e8e46f18d24281aaf..50e83e276406714b03ab8d199a16259ee574ffbf 100644 (file)
@@ -4,7 +4,17 @@
    seconds, starting 10 seconds in, the main thread prints the
    load average.
 
-   The expected output is this (some margin of error is allowed):
+   The expected output is listed below.  Some margin of error is
+   allowed.
+
+   If your implementation fails this test but passes most other
+   tests, then consider whether you are doing too much work in
+   the timer interrupt.  If the timer interrupt handler takes too
+   long, then the test's main thread will not have enough time to
+   do its own work (printing a message) and go back to sleep
+   before the next tick arrives.  Then the main thread will be
+   ready, instead of sleeping, when the tick arrives,
+   artificially driving up the load average.
 
    After 0 seconds, load average=0.00.
    After 2 seconds, load average=0.05.
@@ -117,7 +127,7 @@ test_mlfqs_load_avg (void)
 {
   int i;
   
-  ASSERT (enable_mlfqs);
+  ASSERT (thread_mlfqs);
 
   start_time = timer_ticks ();
   msg ("Starting %d load threads...", THREAD_CNT);