HW4: | |
a SCHED_FSGS task will run only if the scheduler is called and both the active task queue array and the expired task queue array are empty (SCHED_FSGS tasks will not be in the queues, of course). |
HW4: Explain the lines: | |
The mechanism should remember task switching events (include non GS tasks). But, if we will remember all the switching event the number of events will be too big. Therefore: 1. For each creation/ending of a task, the mechanism should remember the 10 switching events that occurred after the creation/ending. 2. Now the number of switching events to remember decreases, but it still too big. So, from all the events that follow the first rule, the mechanism should remember only 100. The 100 that is chosen to be remembered is the 100 latest events. Example: C is a task creation event. S or s is a task switching event. E is a task ending event. Then the mechanism should remember the inly swithcing events that marked with big S: .......CsssssSSSSSsESSSSSSSSSSssssCSSSSSSSSSSssssCSSSS SSSSSSssssESSSSSSSSSSCSSSSSCSSSSSSSSSSsssCSSSSSSSSSSESSSS SSSSSSsCSSSSSSSSSSssCSSSSSSSSSSss(present time) |
HW4: | |
Example program - We give you source code for "proof_of_concept" (part2 -user mode). - Now you don't have to submit "proof_of_concept" part2 - user mode,but you should submit output of proof_of_concept with explanations. - You still have to implement system call "sys_statistic". - Note that in order to test new scheduling policy you will have to change 'policy' variable to SCHED_FSGS value. To make the assignment easier use this tips: * To protect your data, you should only mask interrupts.the way to do it is: /* declare an unsigned long */ unsigned long flags; local_irq_save(flags); CRITICAL CODE local_irq_restore(flags); * You can assume that changing the weight of a group will be done only from one of the group tasks, this task will be a GS task.(that means that a group that its weight was changed has a running GS task.) * setpgid(): * Calling setpgid() will be called only from a non GS task code. * setpgid() will be called only for creating a new group, and the caller will be the new group leader.(the only way setpgid is called is with parameters setpgid(0,0) ) * You can assume that a GS task will not become to a non GS task. * You can assume that the system call set_priority() will not be called by the user. Functions you probably have to change : Function name | Filename ------------------------------------------ dequeue_task | sched.c enqueue_task | sched.c activate_task | sched.c deactivate_task | sched.c scheduler_tick | sched.c schedule | sched.c setscheduler | sched.c sched_init | sched.c nr_running | sched.c New functions: sys_statistic | sched.c sys_getgroupweight| sched.c sys_setgroupweight| sched.c Don't forget to add new system calls to ENTRY.S . | |
קישור: Link: Ссылка: وصلة: | http://www.cs.technion.ac.il/~cs234120/groups.c |
You can add fields to task_struct | |
You can add fields to task_struct |
HW4: | |
When calculating the time slice of a GS task, you should only consider groups that has a RUNNABLE GS tasks. meaning, in the ex test it should be: Let Ng be the number of task groups that have a runnable GS tasks |
HW4: | |
When a task goes out for waiting, you can remove it from your data, make sure that it returns to your data when it return from waiting. |
HW4: | |
When all group tasks goes to waiting you can remove the group from your data (but, you should keep its weight - can be kept it in the task_struct). |
HW4: | |
Since a group weight can only be changed by its own group, one argument of setgroupweight() is irrelevant, therefore you can implement it with one argument or two. |
HW4: | |
You shouldn't change anything in schedule() after the label 'switch_tasks:'. |
Is there a general function which is called every time a task dies? | |
do_exit |
HW4: | |
The weight of a group can be changed while some of its tasks are waiting. So if your data doesn't contain waiting tasks,and you decided to keep the group weight in the task_struct, you might have to go over all the tasks (use for_each_process()) |
About the statistic function .... | |
All tasks. |
Can we assume that sys_statistics is being called only after 100 Context | |
No you cant. In that case you have to fill the rest of the struct with zeros. |
HW4: | |
Those of you how get this message : pcnet32.c:v1.27a 10.02.2002 utsbogendatalpha.franken.de should recompile the module: > 'make modules' > 'make modules_install' > 'mkinitrd ' |