Re: How do Linux handle process priority inversion?



Chris Friesen <cbf123@xxxxxxxxxxxxx> wrote in part:
Both RR and FIFO still use the scheduler and thus priorities
still apply.

Certainly. But _when_ they apply is the question.
The scheduling _policies_ are very different, including
run-to-completion[or block] (FIFO).


Consider the following, where all tasks are either RR
or FIFO.

If I have task B that is a cpu hog, and something happens
to wake up task A (which is higher priority than B), then
task A should run. Do we agree so far?

No, we do not agree. Task A doesn't "wake up" under RR or FIFO.
If it unblocks, then it waits for RR or FIFO to time-out/complete
(respectively) Task B and the scheduler to run again. These are
not pre-emptive scheduling policies and certainly can block
the system. That's why they require root to set.

You may find more at:
http://www.opengroup.org/onlinepubs/000095399/xrat/xsh_chap02.html#tag_03_02_08_16

Of course some people don't like these primative policies,
however POSIX they may be. So various patches have been
written (SCHED_SOFTRR).

These scheduling policies have been designed for stochastic system
throughput under relatively fixed conditions, like on a realtime
system. Co-operative multitasking techniques are mandatory.

-- Robert

.



Relevant Pages

  • Re: Mutex and Critical Sections
    ... For a critical section, FIFO would be fair. ... A naive scheduling algorithm might ... > If I understand it correctly, FIFO strategy is not a fair strategy. ...
    (microsoft.public.vc.language)
  • Re: [sched-devel, patch-rfc] rework of "prioritize non-migratable tasks over migratable
    ... both "violates" POSIX if a strict round-robin ... btw., rt group scheduling seems to well, slightly wreck this ... FIFO model as well. ...
    (Linux-Kernel)
  • Re: RT task scheduling
    ... Global scheduling either means a global lock, ... whether the priority range needs to be extended to a much ... -rt SCHED_FIFO as a basic building block for other policies (done by ... Rebalancing in allocation ...
    (Linux-Kernel)
  • Re: Windows Task Scheduler looses account credentials data
    ... The result migh take A WHILE, ... I am scheduling simple ... this issue may be caused by group policies. ... Is it convenient for you to setup a new computer without joining the ...
    (microsoft.public.windowsxp.general)
  • Re: [RFC][PATCH] Multimedia scheduling class
    ... realtime scheduling class -- using a proportional class like you did ... with the normal tasks while giving a slightly more responsive scheduling ... become rather close to running FIFO with flat priority? ...
    (Linux-Kernel)