LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 10-18-2016, 02:44 PM   #1
armag
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Rep: Reputation: Disabled
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?
 
Old 10-18-2016, 03:12 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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?
 
Old 10-18-2016, 04:24 PM   #3
armag
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
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.
Old 10-18-2016, 04:30 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,056
Blog Entries: 4

Rep: Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068
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.
Old 10-18-2016, 05:43 PM   #5
armag
LQ Newbie
 
Registered: Mar 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Perfectly agree with you, but was just trying to set some specific process to RT to see the effects on a benchmark.
Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Red Hat powers cloud-scale DevOps with the general availability of Red Hat Cloud Suite and Red Hat OpenStack Platform 8 LXer Syndicated Linux News 0 04-20-2016 05:20 PM
LXer: Red Hat's Green Friday: 25% Jump In Stock Is Nice Christmas ... LXer Syndicated Linux News 0 12-30-2006 03:21 AM
Nice values of 0 and 19 get same amount of CPU frenk Linux - General 2 02-01-2006 04:51 AM
Are changes to nice values logged? BrainScanning Linux - Software 1 06-22-2005 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration