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

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

Post by ?BIG5?B?s1 » Sun, 25 Jun 2006 18:30:11

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
Sorry for my poor English, I will try to explain clearly at my best.

The main question I have is that why even I have lots of SCHED_FIFO
process with same
priority, it still have time sharing behavior? And at any time point,
there is always only one
process in the runqueue?

Following is the full story:

I have to do a homework that tearcher asks us impelement an EDF
real-time process
scheduling policy in Linux, so I am trying to understanding how Linux
real-time process
scheduling work, and do the homework baed on this.

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.

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

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.

Beside this, I also modify kernel/sched.c and add the following code
after line of
"next = list_entry(queue->next, task_t, run_list);"

====== Code Start =======
/* Print all element in the real-time task runqueue */
if ( idx < 100 ) {

struct task_struct * i;

printk ( "RT-Queue[%d]:", idx );

list_for_each_entry ( i, queue, run_list ) {
printk ( "P[%d] ->", i->pid );

printk ( "\n" );
====== Code End =======

As I mentioned, after these modify, no matter how many SCHED_FIFO process I
am running, there are always only one process in the runqueue, why?

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?

1. How to run queue, but only send to one address at a time

2. UserControl behaviour at author-time design-time and run-time

Hi all,

Can a user control be written in such a way that it can behave differently
depending on whether it is being authored, being used on a form in VS2003 and
being used at runtime? If so, how does it tell the difference between these

I am developing a user control based on the ListView control that will
display a subset of the application event log, given a named event source.

In order to make the control show event log data in design-mode as well as
at run-time, I altered the constructor so that it would populate the ListView.

To avoid unwanted delay, the function that populates the ListView runs in
its own thread. Despite this, there is a significant delay when I switch from
code-view to design-view in a WinfForms app that uses this component, during
development. It takes about 15 seconds to switch views.

Is there anything I can do to avoid this. I am trying to deisgn the control
so that it looks the same at design time as it does at run-time.


3. scheduler/SCHED_FIFO behaviour

4. Strange behavior in run-time vs. dbx behavior when using shmget

5. Maximum cscripts processes running at one time

6. animated gif in iframe doesn't animate first time frame is displayed for long running process

7. Linit the number of external process running at any one time

8. Max cscripts processes running at one time?

9. Add-ins to make Outlook.exe process keep running after Outlook

10. Add-ins to make Outlook.exe process keep running after Outlook clo

11. Determining control behaviour at design-time/run-time

12. different behaviour design time / run time

13. How to count process running time ( process not finished)

14. [Question] Can we release vma that include code when one process is running?

15. strange behavior between design time and run time