Is there any way that application thread can boost priority of Kernel thread in Linux
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.
Is there any way that application thread can boost priority of Kernel thread in Linux
Question: Is there any way that application thread can boost priority of Kernel thread in real time Linux Kernel?
Background:
I am using Linux 2.6.14.7
In my software I have some application threads that run with real time scheduling policy - ‘SCHED_RR’ (Round Robin Policy) and with priority of 20.
I have requirement of sending a (custom) message over Ethernet in real-time.
When one of the application thread detects a particular condition I want to send one message over Ethernet to my client application that is connected.
Though I could see that my application thread is calling socket library send() system call in real time however the client application connected over Ethernet is unable to receive that message in real time.
My idea is – if I could increase the priority of Kernel thread that handles clearing of Ethernet Network Cache after calling socket library send() system call then I should be able to send the message over Ethernet in real time.
Thanks for the response.
In my project we are using Linux Kernel provided by Wind River, exact version details - 2.6.14.7-tiny1-WR1.3al_small.
Workaround that i have found-
After calling the socket library send() if i make the application thread sleep, i could receive the message in client application in real time. I am not sure if this is right thing to do.
In my tests i could find that the sleep duration is dependent on the number of threads running in the system.
Having fast, dedicated hardware with nothing else to do is a plausible workaround but not guaranteed. Linux is not, and is not designed to be, a "real time" kernel. If at all possible, find a way to redesign the requirement so that there are greater timing tolerances. (You probably need to do that anyway if you are dealing with TCP/IP.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.