LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-13-2012, 01:55 PM   #1
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321
Blog Entries: 1

Rep: Reputation: 31
Real Time attributes (chrt) vs nice


I've read documentation and tried setting a critical process with real-time attributes, ex.:

Code:
# chrt -r -p 90 $(pidof myprocess)
That change in priority can be seen within top.

I just was wondering what's the difference between seting "niceness" priority with nice/renice and change chrt attibuttes. I suppoused chrt offers better "fine tune"... Are there other differences?

Regards,
Matías
 
Old 03-13-2012, 09:24 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
One thing that you need to (please!) remember about Linux is that it is not fundamentally designed to be a "real-time" operating system.

Yes, it has certain available features which are "nods in that general direction," but (IMHO) a true "real-time OS" cannot be "general purpose" and vice-versa. I believe that an OS-designer must, fairly early on, choose one direction or the other and then remain consistent with that direction. (Lest you wind up failing to satisfy both, at once!)

(Again, IMHO...) A true RTOS is a very specialized beast: you have a machine to control, and human beings are potentially at risk of their lives if you screw up. The system that is controlled by the RTOS does nothing else. A general-purpose operating system such as Linux has a much broader set of objectives, and it must be allowed certain concessions in order to meet those objectives: concessions which an RTOS could not allow if it is to to meet its objectives. "And never the twain shall meet..."
 
Old 03-14-2012, 07:19 AM   #3
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Thanks a lot for your explanation and considerations on designs of RTOS and General porpouse OS, found it very interesting.

My doubt is if are there any difference between the way linux kernel prioritizes using chrt or nice.

Regards,
Matías
 
Old 03-14-2012, 08:03 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Well... man chrt

The main purpose of this command is to set the scheduling algorithm that is to be used for a particular process.

The fly in this ointment, of course, is that in an actual RTOS situation, it really doesn't work well to set the algorithm for "one process," or even for a group of processes, when other processes on the same system don't work the same way. Somebody's gonna get the short end of the stick.

If you look at the scheduling behavior of a given process, when it has control and as long as it has control, then, yes, it will get dispatched as the chosen algorithm indicates. However, if you look at the behavior of the system over time, you now see a curious and rather dysfunctional (IMHO) admixture... kind of like a committee meeting.

Of course, Linux is doing the best that it can, given the (intentional) design that it has. You are putting apples and oranges together in the same bushel basket, and it's trying its best to make tasty juice out of them, but (IMHO) it's a problem that really can't be solved.

Last edited by sundialsvcs; 03-14-2012 at 08:05 AM.
 
Old 03-15-2012, 07:40 AM   #5
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Thanks

I understood... Thanks a lot for your kind explanation!!
With the few test I did I didn't find big difference after changing schedulling algorithm and giving extra priority for on of my processes. But may be that's because of the "nature" of the process or related to the facts you exposed me.

Thanks a lot. Regards,
Matías
 
Old 03-15-2012, 10:29 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Glad to have (maybe) helped...

My general thought on the matter is that, if you have a multi-million dollar very dangerous machine to control, use a purpose-built RTOS to control that machine ... (pretty please) ... and then, use a general-purpose OS such as Linux (of course...) running on a different circuit-board in the same machine perhaps, to talk to it. (Using the equally-peculiar software that the RTOS vendor has provided expressly for that purpose.)

One machine (IMHO) just can't be asked to satisfy both sets of requirements at once. It doesn't make sense. But two machines can, and now it does make sense. Thankfully, "machines" are relatively easy to come by these days.
 
  


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
LXer: Busyhot - A Nice Little Gnome Panel Applet to Show Real Time CPU Load and Temperature LXer Syndicated Linux News 0 08-17-2010 11:00 PM
real time kernel not real time, still xruns in Jackd browny_amiga Linux - General 0 09-20-2009 02:47 PM
Difference between chrt and nice with PREEMPT_RT kernel jaakkos Linux - Kernel 0 03-27-2009 07:33 AM
LXer: Real-time garbage collection with Real-time Java LXer Syndicated Linux News 0 05-05-2007 12:16 PM
LXer: Real-time Linux gains real-time JVM LXer Syndicated Linux News 0 10-12-2006 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:20 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