LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-09-2010, 09:14 AM   #1
reta
LQ Newbie
 
Registered: Jan 2010
Posts: 16

Rep: Reputation: 0
Exclamation wfq


Hi,

I Want to know how to implement sch_wfq.c or qdisc_wfq.c on linux

please help me

Thanks
 
Old 03-10-2010, 04:34 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
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.
 
Old 03-10-2010, 11:03 AM   #3
reta
LQ Newbie
 
Registered: Jan 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by neonsignal View Post
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.

best regards

Last edited by reta; 03-10-2010 at 11:05 AM.
 
Old 03-14-2010, 08:31 AM   #4
reta
LQ Newbie
 
Registered: Jan 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Unhappy

any one help me please
 
Old 03-14-2010, 09:05 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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?
 
Old 03-15-2010, 07:03 AM   #6
reta
LQ Newbie
 
Registered: Jan 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
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.

regards
 
Old 03-15-2010, 08:27 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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.
 
Old 03-16-2010, 10:04 AM   #8
reta
LQ Newbie
 
Registered: Jan 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
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.

you can send the details here or to my email

reta.sg238@yahoo.com

Best regards
 
Old 03-16-2010, 10:09 AM   #9
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by reta View Post
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.

you can send the details here or to my email

reta.sg238@yahoo.com

Best regards
Use WEB search for, say,

Linux kernel compilation howto
.

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.
 
Old 03-16-2010, 10:11 AM   #10
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
reta, start from http://kernelnewbies.org/ .
 
Old 03-16-2010, 10:32 AM   #11
reta
LQ Newbie
 
Registered: Jan 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Sergei Steshenko View Post
Use WEB search for, say,

Linux kernel compilation howto
.

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.
 
Old 03-16-2010, 12:47 PM   #12
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by reta View Post
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.
No way I am going to do your job.
 
0 members found this post helpful.
Old 03-16-2010, 02:21 PM   #13
reta
LQ Newbie
 
Registered: Jan 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Sergei Steshenko View Post
No way I am going to do your job.
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
 
Old 03-16-2010, 02:58 PM   #14
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by reta View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Needing the source code implementing WFQ rickie Linux - Networking 1 07-29-2002 10:06 AM


All times are GMT -5. The time now is 03:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration