Re: A question about behavior of SCHED_FIFO: Only one process in run queue at any time.

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

 



On Sat, 24 Jun 2006, [BIG5] ³\¬¥»¨ wrote:

>
> I have read some textbook about OS and Linux kernel, according to these books,
> SCHED_FIFO is a real-time scheduling policy, and when a process is a SCHED_FIFO
> process, it will be preempted only when follwing case happend:
>
> 1.There are some process with higher priority.
> 2.The process is in blocking opreation.
> 3.The process is dead.
> 4.sched_yield()

That all sounds right.

>
> Man page of sched_setscheduler even says:"SCHED_FIFO is a  simple
> scheduling  algorithm  without  time slicing."

Correct.

>
> Then I worte an user space program (in the attachment),
> which fork an SCHED_FIFO child process, it does nothing expect an infinite loop
> and print something on screen.

How did you run more than one SCHED_FIFO process?  If you are not on a SMP
machine, as soon as you run 1 of these children, it will run to completion
because it is higher priority than any other process.  So the next
child you run will run after that.

>
> Here is the dmesg result, it is clearly these process is in the same
> queue, and there
> is only one process in the queue at any time point.
>
> RT-Queue[1]:P[9822] ->
> RT-Queue[1]:P[9822] ->
> RT-Queue[1]:P[9810] ->
> RT-Queue[1]:P[9810] ->
> RT-Queue[1]:P[9816] ->
> RT-Queue[1]:P[9816] ->
> RT-Queue[1]:P[9822] ->
> RT-Queue[1]:P[9822] ->
>
> Did I misunderstand about SCHED_FIFO policy?
>

No, but I still don't know how you ran all of them.

-- Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux