Monday, April 9, 2012

Pintos- implementing the mlfqs scheduler

Hi, Its been a while since my last post on pintos, as I have been quite busy at work. As promised in the last post, here is the link to my pintos repository :  https://github.com/sup3rcod3r/pintos. You can watch it to keep up with the developments.
A quick way to clean and compile any code changes is to run
$make clean && make check
from the project/build folder. This compiles the kernel and starts running all the tests.
In the next exercise, I skipped the priority donation part, and jumped on to implementing the mlfqs scheduler. It was quite a fun exercise, getting to learn about fixed-point arithmetic, and its use in the pintos kernel, where float numbers aren't supported. An important point to remember is that you have to consider the idle thread while calculating load-avg and recent-cpu values. Since it doesn't contribute to these values, it is good to check for it in the get functions, and return if true. After I got this bit right, nearly all of the scheduler tests passed.
Output as of now :

pass tests/threads/alarm-single
pass tests/threads/alarm-multiple
FAIL tests/threads/alarm-simultaneous
pass tests/threads/alarm-priority
pass tests/threads/alarm-zero
pass tests/threads/alarm-negative
FAIL tests/threads/priority-change
FAIL tests/threads/priority-donate-one
FAIL tests/threads/priority-donate-multiple
FAIL tests/threads/priority-donate-multiple2
FAIL tests/threads/priority-donate-nest
FAIL tests/threads/priority-donate-sema
FAIL tests/threads/priority-donate-lower
FAIL tests/threads/priority-fifo
FAIL tests/threads/priority-preempt
FAIL tests/threads/priority-sema
FAIL tests/threads/priority-condvar
FAIL tests/threads/priority-donate-chain
pass tests/threads/mlfqs-load-1
pass tests/threads/mlfqs-load-60
pass tests/threads/mlfqs-load-avg
pass tests/threads/mlfqs-recent-1
pass tests/threads/mlfqs-fair-2
pass tests/threads/mlfqs-fair-20
pass tests/threads/mlfqs-nice-2
FAIL tests/threads/mlfqs-nice-10
FAIL tests/threads/mlfqs-block

Follow the requirements closely, as they contain most of the clues to finishing the exercise.