Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
on my system. I tested a c++ program and measured the completion time of it which was 420 ms. I want to know whether this execution time might even reduce more if I configure the kernel as real time and preemptive.
I think all kernels above 2.6 are configured as preemptive by default.
If enabling some flags in .config would reduce the execution time, I would thank if you could clarify those flags for me.
Furthermore, I also thank if someone could note the difference between real time and preemptive to me.
A realtime kernel really only gives you predictable performance, not necessarily high performance. You might have more luck tying your process to a specific cpu with numactl and dedicating another cpu to handle interrupts.
I know you're not running RHEL but there's a good tuning guide here that you should get some value out of.
Also bear in mind that the completion-time of a program includes all of the "set-up and tear-down" time. Reading files, finding and loading from libraries, initialize everything, do the work, and then tear everything back down. That's quite a bit of one-time overhead.
What you probably want to be measuring is how long the process is actually "doing the work," and you want to set things up so that it is able to "do the work" repeatedly during its lifetime.
A traditional, pre-emptive kernel like Linux is designed to give "good and consistent" performance no matter what happens. To be fair.
A real-time kernel, on the other hand, is designed to guarantee (as much as such things can be guaranteed) that the system will, say, respond to a particular interrupt within X microseconds and pass control to a particular process within Y microseconds. Predictably. And, such that you can dedicate an entire CPU and maybe an entire motherboard to doing "nothing but that." (A traditional pre-emptive OS is often used, on another motherboard connnected to it, to "feed and care for" the RTOS, providing a user-interface to it and relieving it of all other duties.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.