Hello....
On 11/6/05, Filip Iliescu <djpriya@xxxxxxxxx> wrote:
I am trying to simple change the timeslice variable in the PCB block
of a process found in the typedef struct task_t by implementing a
system call.
Are there any race conditions or reasons I should synchronize this
variable before I alter this timeslice? Are there any reasons it
would fail?
You want to change how much timeslice is assigned to each process by creating a new syscall ? Do you mean, extending the timeslice left or simply increase/decrease the timeslice for the next epoch for a process?
I haven't tried it by myself, but I think if you really want to create one, please consider to disable interrupt timer. As you might know, timer softirq is the one which decrements the timeslice variable by one on every timer tick. Therefore, there is a (big) chance that you introduce race with this timer softirq. Do this disabling action real quick unless you want to lengthen clock drift.
Personally, I think changing time slice directly via system call is too "agressive". I suggest to do it inside the scheduler related function itself to change the the timeslice based on certain condition. The common practice is just providing syscall to change nice level, and from this nice level, dynamic priority is calculated thus timeslice is finally determined.
Anyway, I don't want to discourage you. Just give it a try....
regards
Mulyadi