LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 09-11-2018, 10:02 PM   #1
rksyeung
Member
 
Registered: Feb 2018
Posts: 71

Rep: Reputation: Disabled
Linux Priorities + Nice (confused)


Real-time scheduling offers priorities 1 (low) to 99 (high). Non-realtime has default of 0, thus lower than lowest RT priority.

Nice value applies to only non-RT processes. The larger the nice value is, the nicer a process is. Am I correct so far?

I'm mainly interested in RT processes now. I see online discussion talking about use of /proc/PID/stat to get priority value, which has a range of -2 to -100 for RT.

This is what confused me - how do we map -2 to -100 into 1 to 99? Is -100 considered the lowest priority thus would map to 1, and -2 would map to 99 [essentially adding 101 to the negative range and we'd get to the proper +ve range]?

Finally, does anyone else find this confusing? I mean, would it be more straightforward if Linux defines say two classes - RT and non-RT, and have 1 single range to describe all priorities?
 
Old 09-11-2018, 10:13 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
A web search for "linux nice" turns up many tutorials.

This might be a good one to start with: https://www.lifewire.com/uses-of-com...renice-2201087

To respond to your last question, I don't find it at all confusing because I have no need to use the nice command.
 
Old 09-11-2018, 11:06 PM   #3
rksyeung
Member
 
Registered: Feb 2018
Posts: 71

Original Poster
Rep: Reputation: Disabled
Hey frank bell, I'm trying to understand RT priority mapping, not the nice, or renice. Not at this time anyway.

In particular, I'm trying to map the value returned from reading /proc/PID/stat, which has a range -2 to -100 into a range 1 to 99. It's not very clear how the mapping is done, esp. consider how some online articles use high/low as an adjective to describe nicety.
 
  


Reply



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
Process Priorities and Linux. SAMPCam Linux - General 12 03-20-2008 04:44 PM
Poll: Priorities for Linux and OSS pixellany Linux - General 44 03-13-2007 08:18 AM
Possible Poll on Linux Priorities pixellany Linux - General 38 02-24-2007 03:09 PM
Can you change thread priorities in Linux? jmyrtle Linux - General 2 03-23-2004 05:57 AM
Nice and confused about nice Hangdog42 Linux - General 5 06-03-2003 04:44 PM

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

All times are GMT -5. The time now is 02:37 PM.

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