![]() |
.. (לתיקייה המכילה) | |
Can we change anything in schedule() after the label 'switch_tasks:'? | |
Please disregard this requirement of the homework: You shouldn't change anything in schedule() after the label 'switch_tasks:' (you may change any code you need) |
Is time measurement that is proposed in the homework correct? | |
Time measurement that is proposed in the homework is wrong (clock() only measures the CPU time of the process while you need to measure its total run time). Please see Piazza for an alternative solution. |
Where tu put get_scheduling_statistic? | |
Please create wrapper.h/wrapper.c and put the get_scheduling_statistic in there. Submit these files along with the test program |
Should we update sleep_avg for PRIO tasks when they return from waiting? (I mean in activate_task) | |
Yes. You should update the sleep_avg in activate_task (the same way it is done now). In wake_up_forked_process you do not need to use CHILD/PARENT_PENALTY. |
What priority should we give to process when it becomes PRIO? (I mean in setscheduler) | |
Regarding the update of dynamic property (p->prio) : Initialize the value in sched_setscheduler. Init the dynamic priority to static_prio = 120+nice; prio = static_prio - bonus, while bonus is calculated as 2*range*sleep_avg/MAX_SLEEP_AVG - range Update the value of prio either if the timeslice of the process is over or the nice is reset (no need to update in other cases) You should (not a must) use effective_prio() for this; make sure that effective_prio() calculates bonus correctly for PRIO processes Note that the kernel will not do floating point operations for you, only integers. This means that you should calculate bonus like this (otherwise you will get only -range/+range): 2*range*sleep_avg/MAX_SLEEP_AVG - range |
Is it ok to put sys_get_scheduling_statistic implementation in sched.c? | |
Yes |
Should the bonus for PRIO tasks cover all the range of [-range , range] or only the edges (-range and range only, nothing between them)? | |
Bonus should be in [-range;+range], please see the note above |
Should we avoid the use of parent/child penalty only for prio processes? | |
Yes, you should not change the behaviour of other policies |
Does it matter how exactly we define SCHED_PRIO? | |
Please make sure that you define SCHED_PRIO in the following way: #define SCHED_PRIO 3 |