X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fthreads.texi;h=40565994f536bbbec06e7a9beb25ae494cd4a60a;hb=3ddaa7092a49f2164cc41c77b142132216e8a5fe;hp=314ee61ca865aef58c4cb51cc4260eea8a965001;hpb=47009e4e26e13451ef152a57f95ad335ea261f87;p=pintos-anon diff --git a/doc/threads.texi b/doc/threads.texi index 314ee61..4056599 100644 --- a/doc/threads.texi +++ b/doc/threads.texi @@ -591,6 +591,34 @@ to cause many of the tests to fail. @item How do I run the tests? @xref{Testing}. + +@item Why do I get a test failure in @func{pass}? + +@anchor{The pass function fails} +You are probably looking at a backtrace that looks something like this: + +@example +0xc0108810: debug_panic (../../lib/kernel/debug.c:32) +0xc010a99f: pass (../../tests/threads/tests.c:93) +0xc010bdd3: test_mlfqs_load_1 (../../tests/threads/mlfqs-load-1.c:33) +0xc010a8cf: run_test (../../tests/threads/tests.c:51) +0xc0100452: run_task (../../threads/init.c:283) +0xc0100536: run_actions (../../threads/init.c:333) +0xc01000bb: main (../../threads/init.c:137) +@end example + +This is just confusing output from the @command{backtrace} program. It +does not actually mean that @func{pass} called @func{debug_panic}. In +fact, @func{fail} called @func{debug_panic} (via the @func{PANIC} +macro). GCC knows that @func{debug_panic} does not return, because it +is declared @code{NO_RETURN} (@pxref{Function and Parameter +Attributes}), so it doesn't include any code in @func{pass} to take +control when @func{debug_panic} returns. This means that the return +address on the stack looks like it is at the beginning of the function +that happens to follow @func{fail} in memory, which in this case happens +to be @func{pass}. + +@xref{Backtraces}, for more information. @end table @menu @@ -689,4 +717,12 @@ just before the first @func{printf} in @func{main}. Then modify It doesn't have to. We won't test priority donation and the advanced scheduler at the same time. + +@item Can I use one queue instead of 64 queues? + +Yes, that's fine. It's easiest to describe the algorithm in terms of 64 +separate queues, but that doesn't mean you have to implement it that +way. + +If you use a single queue, it should probably be sorted. @end table