Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-18-2016, 02:44 PM
|
#1
|
LQ Newbie
Registered: Mar 2016
Posts: 3
Rep:
|
Red Hat 7 nice values
It appears that Red Hat 7 process nice values range is 0-99 with 0 being the lowest priority.
On other Linux distributions, various forums talk about nice values ranges -20 to 19. In Red Hat, higher priority values are higher number, in the other case the more negative value assign higher priority to a process. Is this correct? Why such a difference?
|
|
|
10-18-2016, 03:12 PM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
All indications I see on my RHEL7 system say it still does the -19 to 20 with lower numbers being higher priority. The man page for setpriority has a nice discussion of this.
What are you seeing that makes you think it is 0 - 99?
|
|
|
10-18-2016, 04:24 PM
|
#3
|
LQ Newbie
Registered: Mar 2016
Posts: 3
Original Poster
Rep:
|
I used chrt command to find out minimum and maximum valid priorities for each scheduling algorithm and I've got this:
# chrt -m
Output:
SCHED_OTHER min/max priority : 0/0
SCHED_FIFO min/max priority : 1/99
SCHED_RR min/max priority : 1/99
SCHED_BATCH min/max priority : 0/0
SCHED_IDLE min/max priority : 0/0
I then found out in another LQ post that values 1-99 are used to set Real Time priority for when an RT scheduling policy like SCHED_FIFO or SHED_RR is set. So, calues -20 to 19 are for non real time processes and I believe the scheduler order would be
to pick first a process in a RT scheduling class (if that exist/is set) then in the other scheduling policy, and within each scheduling policy the process with highest priority (i.e: for RT , higher values near 99, for others policies non RT, then lower nice values have higher priority, like near -20).
I haven't tried to set my own scheduling policies for set of processes, so what ever I stated here may not be exactly working as I stated.
Thanks.
|
|
1 members found this post helpful.
|
10-18-2016, 04:30 PM
|
#4
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,056
|
You are correct that the priority (nice ...) value ranges are different for the different available schedulers.
Linux would not be my choice for a true "real-time" application. Linux is a general purpose operating system, and this permeates its entire design. True RTOSes are not the least bit "friendly" to interactive users and generally do not support them at all.
For the "ordinary" scheduler, the nice setting is only one of several inputs that are considered, and usually the only thing that really matters is that "the setting is 'nice.'" It doesn't matter so much "how 'nice'" it is. You're simply giving the scheduler a clue that this particular unit of work isn't interactive and can afford to receive "less, but longer" time slices. (If the work does a lot of I/O or otherwise creates high non-CPU demands on the machine, it won't be very "nice" no matter what you say.)
Last edited by sundialsvcs; 10-18-2016 at 04:34 PM.
|
|
1 members found this post helpful.
|
10-18-2016, 05:43 PM
|
#5
|
LQ Newbie
Registered: Mar 2016
Posts: 3
Original Poster
Rep:
|
Perfectly agree with you, but was just trying to set some specific process to RT to see the effects on a benchmark.
Thanks!
|
|
|
All times are GMT -5. The time now is 04:03 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|