Improve comment.
[pintos-anon] / src / tests / threads / mlfqs-fair.c
index fd8ab86369c497038af4553034a24134ff900db6..3b1bea5a177301abb2d6b28b9887a3baf2a1a1ae 100644 (file)
@@ -1,3 +1,20 @@
+/* Measures the correctness of the "nice" implementation.
+
+   The "fair" tests run either 2 or 20 threads all niced to 0.
+   The threads should all receive approximately the same number
+   of ticks.  Each test runs for 30 seconds, so the ticks should
+   also sum to approximately 30 * 100 == 3000 ticks.
+
+   The mlfqs-nice-2 test runs 2 threads, one with nice 0, the
+   other with nice 5, which should receive 1,904 and 1,096 ticks,
+   respectively, over 30 seconds.
+
+   The mlfqs-nice-10 test runs 10 threads with nice 0 through 9.
+   They should receive 672, 588, 492, 408, 316, 232, 152, 92, 40,
+   and 8 ticks, respectively, over 30 seconds.
+
+   (The above are computed via simulation in mlfqs.pm.) */
+
 #include <stdio.h>
 #include <inttypes.h>
 #include "tests/threads/tests.h"
@@ -53,7 +70,7 @@ test_mlfqs_fair (int thread_cnt, int nice_min, int nice_step)
   int nice;
   int i;
 
-  ASSERT (enable_mlfqs);
+  ASSERT (thread_mlfqs);
   ASSERT (thread_cnt <= MAX_THREAD_CNT);
   ASSERT (nice_min >= -10);
   ASSERT (nice_step >= 0);