ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
If you have a look in linux-source/net/sched, you will find a number of different scheduling algorithm modules, with names like sch_xxx.c. These include the following:
Class Based Queueing (CBQ)
Hierarchical Token Bucket (HTB)
Hierarchical Fair Service Curve (HFSC)
ATM Virtual Circuits (ATM)
Multi Band Priority Queueing (PRIO)
Random Early Detection (RED)
Stochastic Fairness Queueing (SFQ)
True Link Equalizer (TEQL)
Token Bucket Filter (TBF)
Generic Random Early Detection (GRED)
Differentiated Services marker (DSMARK)
To implement another algorithm, you would need to create a new module. Have a look at sch_sfq.c as an example.
If you have a look in linux-source/net/sched, you will find a number of different scheduling algorithm modules, with names like sch_xxx.c. These include the following:
Class Based Queueing (CBQ)
Hierarchical Token Bucket (HTB)
Hierarchical Fair Service Curve (HFSC)
ATM Virtual Circuits (ATM)
Multi Band Priority Queueing (PRIO)
Random Early Detection (RED)
Stochastic Fairness Queueing (SFQ)
True Link Equalizer (TEQL)
Token Bucket Filter (TBF)
Generic Random Early Detection (GRED)
Differentiated Services marker (DSMARK)
To implement another algorithm, you would need to create a new module. Have a look at sch_sfq.c as an example.
Hi neonsignal,
Thanks for your replay
I know there are number of scheduling algorithm in linux but I want to implement new algorithm , can you give me the steps to do that, I'm using kernel version 2.6.18 CentOs 5.2, I hope you will help me.
I think you will need to give us more information on what you are doing---and why. For example, what are the features that you want to have in the new algorithm? What is it supposed to do and how will it differ from the existing?
I infer from the earlier answer that you are working on a scheduling algorithm for the kernel----correct?
I think you will need to give us more information on what you are doing---and why. For example, what are the features that you want to have in the new algorithm? What is it supposed to do and how will it differ from the existing?
I infer from the earlier answer that you are working on a scheduling algorithm for the kernel----correct?
Hi pixellany,
I want to implelement algorithm like wfq (weighted fair queueing) in linux kernel to make QoS, I know there are many algorithm in linux can do that but I want to add new algorithm (wfq)to linux kernel.
So your question is how to put your custom code into the kernel?
Short answer:
Install the compiler suite (GCC)
Install the kernel source code (available from your distro maintainer or here: http://kernel.org/ )
Find the section of the code that performs the task of interest
Modify the code (or substitute your own)
Compile and install the kernel.
I've you have never compilied a Linux kernel, learn to do that first.
So your question is how to put your custom code into the kernel?
Short answer:
Install the compiler suite (GCC)
Install the kernel source code (available from your distro maintainer or here: http://kernel.org/ )
Find the section of the code that performs the task of interest
Modify the code (or substitute your own)
Compile and install the kernel.
I've you have never compilied a Linux kernel, learn to do that first.
Thanks pixellany for your answer
I'm newbie in programming linux kernel, please send me the previous steps in detail, this is part of my diploma and the remaining time is very short, please help me.
Thanks pixellany for your answer
I'm newbie in programming linux kernel, please send me the previous steps in detail, this is part of my diploma and the remaining time is very short, please help me.
I last compiled Linux kernal probably 10 years ago, and the written instruction were sufficient. AFAIR, there is even a GUI which helps to set kernel configuration, but you most likely won't need it.
I last compiled Linux kernal probably 10 years ago, and the written instruction were sufficient. AFAIR, there is even a GUI which helps to set kernel configuration, but you most likely won't need it.
Hi Sergei Steshenko,
did you know the steps to add new scheduling algorithm to linux,I need all the instruction to do that
I need to add the source code of the scheduling algorithm with all its header and use it by tc command.
I'm just want help, not to do my job,I'm ask if you do that before so you can help me ,I'm not want from you to search and do my job, I search about this subject for long time but not found any thing help, so I ask for help.
I'm just want help, not to do my job,I'm ask if you do that before so you can help me ,I'm not want from you to search and do my job, I search about this subject for long time but not found any thing help, so I ask for help.
any way Thank you
You've already got enough help from the participants, now it's your turn to start doing the real job, i.e. to start reading and trying.
For example, set yourself a goal of compiling the kernel identical to the one you have on your Linux box - it's the easiest way to compile a kernel because you just use the configuration file coming with distro as is.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.