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

Re: 2.6 Scheduler



> How do I determine how long a timeslice is for my scheduler once I set a
> RR policy?

HZ value in kernel sources.

> 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.

> 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.

> Is it possible to not preemp an specific IO access? (When I want to write
> the serial port, I would like to go immediately to the run state and not
> wait)

Take a look on linux realtime preemption patches.
With those, you will be able to move everything - including IRQ processing -
to schedulable threads, and then you will be able to adjust priorities.

In simple cases, if working inside kernel, you may just disable preemption
or even interrupts, and do your i/o without being interrupted.

> Is it possible to yield to a specific process/thread?

As far as I know - only by playing with [realtime] priorities.

Nikita



Reply to: