Re: low priority soft RT?

David Schleef (ds@stm.lbl.gov)
Wed, 21 Jul 1999 23:27:33 -0700


On Wed, Jul 21, 1999 at 09:25:12PM -0500, cd_smith@ou.edu wrote:
> Anyone thought about allowing soft RT (SCHED_FIFO or SCHED_RR) tasks with
> negative priorities? These would only be executed if no other tasks of
> any type are there. Giving a normal Linux task a niceness value won't do
> this, as the task will still get some CPU time.
>
> I was just thinking back to past projects, and about a year ago I wished I
> had something like this to do background housekeeping tasks for a
> distributed application I was writing -- I wanted to do them if possible
> on a free system, and only schedule time on some system if they didn't get
> scheduled anyway.
>
> Since I'm sure this isn't a new idea, any good reasons not to allow this?
> (surely there can't be security implications, right?) I'm not really
> interested in doing it myself right now, but I might in the future if
> there aren't good reasons otherwise.
>
> Chris Smith <cd_smith@ou.edu>
>

Such a change potentially violates the standard, and at the very least,
would be non-portable.

It's also probably a bad idea due to possible priority inversion. A
better solution might be a process that watches the load average, and if
it sees that the load is above a certain threshold, say, 0.1, it releases
all locks and sleeps for a minute. When it wakes, it just repeats the
check to see if it is OK to run. Put this process at nice -20, and it
would truly be a no-priority process.

One caveat is that you need to calculate the load average _minus_ that
caused by the actual process. Another problem would be if you wanted to
run multiple no-priority process -- but then, if you care about fairness,
it's not really no-priority.

dave...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/