Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
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.
In the programming forum there is an individual who is asking a number of questions about RTLinux.
Now, I knew nothing at all about it, so I looked it up and wound up googling for a bit. In a nutshell, RTLinux is a real time kernel that runs a standard Linux distribution as its lowest priority task in a virtual machine environment.
The idea is that RTLinux can give the kind of performance that you need in a real time environment, while making the capabilities of a full-up OS available as well.
OK. That makes sense. RTLinux has been around for about a dozen years, since Linux kernel 2.0 or so.
The Linux kernel prior to 2.6 absolutely reeked as a real time kernel. The semaphore mechanism...the ability - and NEED - to lock the entire kernel for certain things...it was horrible as a real time operating system.
But Linux has grown up a lot, and the 2.6 kernel has versatile locking, semaphore, and interrupt processing mechanisms. I myself have been doing quite a lot of real time work with 2.6, and I haven't run into any particular problems with Linux (though, if you'd like to talk about the RT executive that Texas Instruments provides for its DSPs, I'll bend your ear a bit...)
So what I wonder is this. Has RTLinux passed its "sell by" date? What real time functions are out there now that CAN'T adequately be handled by a 2.6 kernel and an appropriately designed kernel driver?
If your requirements are good interrupt/task switch latency, then 2.6 kernels may do the job very nicely. If your requirements are _guaranteed_ latency, though, not so much.
I think it's a case of 'you'll know if you need this'.
Well...the interrupt and process switching latency you'll see will be dictated partly by how busy the linux system is.
A system being used in a real time application usually won't be busy except for processing that real time system. So, even though linux won't guarantee a certain maximum latency this shouldn't become an issue unless the system is being used for more than it should be used for.
Also, performance monitoring of the system should give a good advance indication of when the system might be getting into trouble.
Though, I do agree that guaranteeing the latency ensures that the RT operation WILL get processed...even if this means that backend operations go hang.
The Linux kernel prior to 2.6 absolutely reeked as a real time kernel. The semaphore mechanism...the ability - and NEED - to lock the entire kernel for certain things...it was horrible as a real time operating system.
My understanding is that the 'critical region' (the region that has to be locked to prevent concurrency problems) has been reduced in size considerably and that has helped massively.
OTOH, it is still there and anything that can be done to shrink it further (well, the time spent in it, rather than the number of lines of code) is to advantage. I'm assuming that, without the need to support a 'desktop/server' codebase the RT suppliers have been able to do a better job than the ordinary kernel....but that's an assumption.
Quote:
I myself have been doing quite a lot of real time work with 2.6, and I haven't run into any particular problems with Linux (though, if you'd like to talk about the RT executive that Texas Instruments provides for its DSPs, I'll bend your ear a bit...)
Well, it sounds as if you don't need it, at least, not on the hardware that you have and with the program structure that you have.
That paper was very well done - and somewhat surprising.
I would love to see it repeated with a more recent 2.6 kernel, to see if the numbers have improved for 2.6. Their benchmark of a 100 Hz system was interesting; presently I am trying to meet the same goal. Right now I need to carve another 8ms out of the control loop to reach that number (on a 1.1 GHz Celeron), but I have identified my problem area as computational and not interrupt latencies.
That paper was very well done - and somewhat surprising.
I would love to see it repeated with a more recent 2.6 kernel, to see if the numbers have improved for 2.6. Their benchmark of a 100 Hz system was interesting; presently I am trying to meet the same goal. Right now I need to carve another 8ms out of the control loop to reach that number (on a 1.1 GHz Celeron), but I have identified my problem area as computational and not interrupt latencies.
8ms have you considered assembly code for that driver ?
or a dedicated micro controller ? (if time is really tight all around )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.