[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 2.6 Scheduler



Thanks for your response.

>> How do I determine how long a timeslice is for my scheduler once I set a
>> RR policy?
> 
> HZ value in kernel sources.


I've tried this and apparently I'm missing something. It appears that my kernel
is using the default 100ms and I have been unsuccessful in changing it by changing HZ alone.
It might be using the jiffy value since I suspect it's using the larger of the two, correct?
However, I haven't found where that's calculated.

Could you tell me where to look?

>> Is their some formula  I could use (using RR policy, nice value and
>> priority) to set a specific (or close to it) timeslice value?
> 
> Check scheduler source in kernel/sched.c - it's not difficult.
> 
>> nice(), as far as I can tell, does not take a parameter, so how do I set
>> it to a specific value? or can I?
> 
> nice() has nothing to do with SCHED_RR or SCHED_FIFO scheduling policies
> -
> it just adjusts a parameter of SCHED_OTHER policy.


Really? If that the case why does nice() affect the execution time and my sched policy is SCHED_RR?
That's very strange.
 

>> If instead of sleep, I use sched_yeild(), does that change any of the
>> parameters for that task scheduling?
> 
> No. The difference is only that sleep() moves current process out of
> ready
> queue for a given time, while sched_yeild() does not.


Do you mean does not move it from the queue or does not have a specific time associated with it?


Thanks again,
--Jr.



Reply to: