Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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).
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
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.