public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: linux kernel mailing list <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	Peter Williams <pwil3058@bigpond.net.au>,
	William Lee Irwin III <wli@holomorphy.com>,
	Alexander Nyberg <alexn@dsv.su.se>,
	Nick Piggin <nickpiggin@yahoo.com.au>
Subject: [PATCH][plugsched 0/28] Pluggable cpu scheduler framework
Date: Sun, 31 Oct 2004 00:32:34 +1000	[thread overview]
Message-ID: <4183A602.7090403@kolivas.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3806 bytes --]

With the recent interest in varying the cpu schedulers in linux, this
set of patches provides a modular framework for adding multiple
boot-time selectable cpu schedulers. William Lee Irwin III came up with
the original design and I based my patchset on that.

This code was designed to touch the least number of files, be completely
arch-independant, and allow extra schedulers to be coded in by only
touching Kconfig, scheduler.c and scheduler.h. It should incur no
overhead when run and will allow you to compile in only the scheduler(s)
you desire. This allows, for example, embedded hardware to have a tiny
new scheduler that takes up minimal code space.

This works by taking all functions that will be common to all scheduler
designs and moving them from kernel/sched.c into kernel/scheduler.c.

Then it adds the scheduler driver struct into scheduler.h which is a set
of pointers to functions that will all have per-scheduler versions.
include/linux/scheduler.h has the definitions for the scheduler driver
structure

kernel/sched.c remains as the default cpu scheduler in the same place to
minimise the patch size and portability of the patch set.

All variables of the task_struct that could be unique to a different
scheduler are now in a private struct held within a union in
task_struct. rt_priority and static_priority are kept global for
userspace interface and for the possibility of adding run-time switching
later on.

The main disadvantage of this design is that there will (initially) be a
  lot of code duplication by different scheduler designs in their own
private space. This will mean that if a new scheduler uses the same smp
balancing algorithm then it will need to be modified to keep in sync
with changes to the default scheduler. If, for example, you modified
just the dynamic priority component of the current scheduler and left
the runqueue and task_struct the same, you could make it depend on the
default scheduler and point most functions to that one.

However, the same disadvantage can be a major advantage. The fact that
so much of the scheduler is privatised means that wildly different
designs can be plugged in without any reference to the number of
runqueues, frame schedulers could be plugged in, shared runqueues (eg on
numa designs), and we could even keep new balancing in a "developing"
arm of the scheduler that can be booted by testers and so on.

What is left to do is add a per-scheduler entry into /sys which can be
used to modify the unique controls each scheduler has, and write up some
documentation for this and staircase.

Anyway the patches will follow shortly, and then (not surprisingly) a
port of the staircase scheduler to plug into this framework which can
also be used as an example for others wishing to code up or port their
schedulers.

While I have tried to build this on as many configurations as possible,
I am sure breakage will creep in given the type of modification so I
apologise in advance.

Patches for those who want to download them separately here:

http://ck.kolivas.org/patches/plugsched/

Here is a diffstat of the patches rolled up.

  fs/proc/array.c           |    2
  fs/proc/proc_misc.c       |   14
  include/linux/init_task.h |    5
  include/linux/sched.h     |   39 -
  include/linux/scheduler.h |   83 ++
  init/Kconfig              |   37 +
  init/main.c               |   10
  kernel/Makefile           |    3
  kernel/sched.c            | 1313
++++++++--------------------------------------
  kernel/scheduler.c        | 1201
++++++++++++++++++++++++++++++++++++++++++
  mm/oom_kill.c             |    2
  11 files changed, 1599 insertions(+), 1110 deletions(-)

Thanks to William Lee Irwin III for design help, Alex Nyberg for testing
and a bootload of others for ideas and help with the coding.

Cheers,
Con


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

             reply	other threads:[~2004-10-30 14:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-30 14:32 Con Kolivas [this message]
2004-10-31 23:33 ` [PATCH][plugsched 0/28] Pluggable cpu scheduler framework Pavel Machek
2004-10-31 23:37   ` Con Kolivas
2004-11-01  1:42   ` William Lee Irwin III
2004-11-01 11:41   ` Ingo Molnar
2004-11-01 13:08     ` Kasper Sandberg
2004-11-01 13:32     ` Con Kolivas
2004-11-01 14:23       ` Nick Piggin
2004-11-01 17:54     ` Jesse Barnes
2004-11-02 21:28     ` Matthias Urlichs
2004-11-02 22:30       ` Peter Chubb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4183A602.7090403@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=alexn@dsv.su.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pwil3058@bigpond.net.au \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox