Re: POSIX soft realtime question

Marc Bechler (mbechler@telematik.informatik.uni-karlsruhe.de)
Fri, 1 May 1998 12:13:14 +0200


>> I was just trying out sched_setscheduler() with 2.1.96. I set
>> sched_priority = 1. No error is returned. One thing though, ps still
>> shows the priority = 0. Is ps wrong, or is there some other problem?

> The normal priority and the realtime priority are stored
> in different fields in the program structure.
> (p->priority vs p->rt_priority)

> Btw: does anybody know why this is done? It seems like
> a waste of space & cycles to me...
> (it could make goodness() faster & save memory)

I think there are two things for this differentiation: The first is that
you have a strict differentiation between the realtime tasks and the
'ordinary' tasks. The second is that p->rt_priority is used only for the
competition of the realtime tasks, while p->priority is used in two ways:
The scheduler (and the goodness function respectively) use (in some
cases) this value to decide which task will be executed next. The p->
priority is also used to (re)initialize the p->counter. If this counter is
zero, the task would be preempted (and reinitialized); so you get
more fairness between the tasks. If you increase the p->priority value for one
task, you will get a better performance for this task :-)

marc

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu