LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Some Question on linux process management.. (https://www.linuxquestions.org/questions/linux-newbie-8/some-question-on-linux-process-management-139871/)

ttianhuat 01-29-2004 12:35 AM

Some Question on linux process management..
 
Hi!~

I face some problem when researching the red hat linux 8.0...Hope somebody can help...
1)What is the Linux default time slice?
2)Linux is preemptive or non preemptive?
**3)How to list out all running process in Red Hat Linux 8.0?
4)What is the linux scheduler?(priority,round robin etc....)...and can it be improved any way, or just is perfect?

Thanks a lot for answering:)

Tinkster 01-29-2004 12:44 AM

Re: Some Question on linux process management..
 
Quote:

Originally posted by ttianhuat
1)What is the Linux default time slice?
Sorry, don't know (never cared).

Quote:

2)Linux is preemptive or non preemptive?
Pre-emptive.

Quote:

**3)How to list out all running process in Red Hat Linux 8.0?
ps -A (pretty much any distro).

Quote:

4)What is the linux scheduler? (priority,round robin etc....)...and can it be improved any way, or just is perfect?
It's actually perfect :} ... there are patches to modify
the behaviour, though, like even pre-empt kernel
level activities to make desktops even more responsive.

You can re-prioritse tasks using nice (man nice for details).



Cheers,
Tink

SciYro 01-29-2004 04:20 AM

linux 2.4.* and lower are non preemtive, only 2.5.(i 4got when but its a development brach so we dont care :)) and up are preemtive built in, there are patches to amke it preemtive in 2.4.* (in fact i use a preemtive kernel patch in 2.4.20 for my laptop works nicly), virtyaly everyhitng in the kernel has a patch to modify it, so what whatever one u want, but i think the process managment is proority driven, "nicer" prosees get better stuff i think it was, im not sure, lol il stop rambling here :)

Tinkster 01-29-2004 09:22 PM

Userspace (non-kernel-level) tasks have always
been pre-empted in Linux.

What you're talking about is the patch to
pre-empt the kernel that I've been talking
about anyway :}


Cheers,
Tink

moses 01-29-2004 10:35 PM

Also, the 2.5.x dev kernel became 2.6.x production some time ago--and, as Tink says, it's fully pre-emptive.
Default timeslice (from kernel/sched.c) is 100 mseconds (I can only assume thats microseconds). Minimum is 10, max is 200.
Tink knows the scheduler isn't perfect. . . It's a priority/round-robin. That is, if a process has a high priority, then it will be given priority, but at specific priority levels, they're in a round-robin. Here, this says it better:

Quote:

/*
* If a task is 'interactive' then we reinsert it in the active
* array after it has expired its current timeslice. (it will not
* continue to run immediately, it will still roundrobin with
* other interactive tasks.)
Quote:


/*
* BASE_TIMESLICE scales user-nice values [ -20 ... 19 ]
* to time slice values.
*
* The higher a thread's priority, the bigger timeslices
* it gets during one round of execution. But even the lowest
* priority thread gets MIN_TIMESLICE worth of execution time.
*
* task_timeslice() is the interface that is used by the scheduler.
*/
The scheduler could be improved, but it depends on what you want to be "snappy". If you want the desktop response to be quick and noticable, then you probably want to give priority to interactive tasks all the time, and you would probably want to be able to assign specific tasks to highest interactive priority (mouse, X11, etc.). The default right now is to have a nice compromise between the interactive and non-interactive tasks (you don't want your updatedb to hang while you post to LQ, do you?). Somewhere on the kernel mailing list archives is a long discussion of how to do the scheduler for 2.5.x/2.6.x. . . You can look it up if you care.


All times are GMT -5. The time now is 01:30 AM.