Re: Creating scheduler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 06 Feb 2013 23:19:26 +0530, jeshkumar555@xxxxxxxxx said:
> Can anyone suggest a good tutorial to create our own scheduler ?

Doing an I/O scheduler is pretty trivial, and there's a number of
examples in-tree already to look at.

If you mean a CPU scheduler, the major reason why there's no tutorial
is because writing a non-toy scheduler is *hard*, and by and large
anybody who's a good enough kernel hacker to write a working scheduler
doesn't need a tutorial.

Why is it hard?  Lots of reasons.  Even on a single-core, single-thread
CPU, it's hard to go a good job of picking the next task to run, mostly
because tasks are so damned good at changing behavior.  You decide that
it would be good to run an I/O bound task, so you pick a task that went
into an I/O wait its last 12 times on the CPU - at which point the task
turns around and goes CPU bound crunching all the data it read in the
last 12 times. :)

You also have interactions with thermal issues and frequency governors
(usually, cranking to highest frequency and doing race-to-idle and then
dropping to lowest freq results in the lowest total energy use, but especially
for high-density applications, there may be a upper limit on watts per second
that you can cool, resulting in trade-offs being needed). Then there's cache
affinity issues, balancing load across cores on multi-socket systems, etc etc
etc...

Attachment: pgppksek2yE3V.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux