If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below. ** If you are logged in, most ads will not be displayed. **

Difference between chrt and nice with PREEMPT_RT kernel

Hello!

Could someone explain to me the difference between using chrt (set realtime priority) and nice when using a PREEMPT_RT kernel?

I've got the impression that setting the real time priority affects how the scheduler shares time between the processes, but how does this compare to the nice level which (to my understanding) should have about the same effect?

I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.

Posts

13,381

As I understand it, the realtime kernel has true realtime processes and not-so-realtime processes (safety-critical process vs. word-processors, for example). To support this kind of behavioral split, the system needs to use a different scheduler for each class of process. Nice works with the standard Linux scheduler, where as chrt works with the realtime scheduler. I haven't worked with RT Linux, so I don't know if a single process can have threads that work with both schedulers (it's possible in theory), but if it does, then I think that nice would only affect the non-realtime threads and chrt would affect the realtime threads.

FYI, my realtime programming experience (about 15 years), was mostly done with the QNX operating system. Though I still noodle with QNX Neutrino, I've been out of that arena as a professional about 10 years now, so I'm not the best resource for you, unless you have a RMA (Rate Monotonic Analysis) or other hard realtime problem. In that case, send me an email and I'll contact you directly. I am an independent IT consultant and work with major semiconductor and electronics manufacturers on similar sorts of problems.

Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!