0

I am planning to code a new scheduler for Linux. I wish to know the current scheduler being used and its "C" code. Where I can find the file containing the code of the scheduler in linux file system.

any references or help regarding how scheduling algorithm can be modified will be great or any source where I can learn from?

  • 2
    It's hard to comprehend how you could consider yourself ready to replace this functionality, and not be able to figure out how to locate it yourself. Learning by doing is a great idea - but for a project of this scale you are going to face many issues which will require more personal initiative than simply locating the relevant portion of the kernel code. As a purely practical suggestion though, build a kernel from source and test it before you make *any* changes, so that you know you are only facing errors you introduce, and not process problems. – Chris Stratton Feb 26 '14 at 15:41
  • Please also make a search in SO before posting. There are quite a lot of questions related to the Linux scheduler already. Take a look at the right pane of this page for an automatic list of related questions. – Christophe Augier Feb 26 '14 at 16:25

2 Answers2

0

Documentation/scheduler includes the documentations of current Linux scheduler, kernel/sched the implementation.

You can clone the Linux repository to your local machine by:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Lee Duhem
  • 14,695
  • 3
  • 29
  • 47
0

The scheduler code is in sched.c in the linux tree, you can open it up to see which is the default scheduler selected.

And too add/change a scheduler, see this post: How to create a new Linux kernel scheduler

You need to have the entire linux source to be able change/add a scheduler. As suggested by @leeduhem, clone the linux source to your machine.

Community
  • 1
  • 1
brokenfoot
  • 11,083
  • 10
  • 59
  • 80