2009-10-10 07:18:46

by Pankaj Parakh

[permalink] [raw]
Subject: How to add scheduler

Hi all,

I want to add my scheduler in linux 2.6.25.3, which have modular
design, is there any document which can explain that modular design of
generic scheduler in detail. I wanted to try my scheduler.

Any guidance..



--
Pankaj Parakh


2009-10-11 23:55:30

by Peter Williams

[permalink] [raw]
Subject: Re: How to add scheduler

On 10/10/09 17:18, Pankaj Parakh wrote:
> Hi all,
>
> I want to add my scheduler in linux 2.6.25.3, which have modular
> design, is there any document which can explain that modular design of
> generic scheduler in detail. I wanted to try my scheduler.
>
> Any guidance..

Not really an answer to you question but related: I'm resurrecting the
CPU plug in scheduler project (to be renamed CPU_PISCH) which aims to
provide an interface for people such as your self to implement CPU
schedulers against and I was wondering if you were interested in adding
your scheduler to this project? Or taking part in other ways?

Thanks,
Peter
PS I'm currently working with respect to the latest kernel rather than
2.6.25.3 (in case that's an issue).
--
Peter Williams [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce

2009-10-23 15:10:56

by Pankaj Parakh

[permalink] [raw]
Subject: Re: How to add scheduler

Hi Peter,

Thanks for showing your interest, I am student and I am working on a
project similar to yours i.e. to have a facility where in one can swap
scheduler in run-time, but I am in very initial state of learning so I
wanted to try a simple RR scheduler, objective of doing it is to learn
about different interfaces in modular design(introduced from 2.6.23
with CFS). I do not have any constraint with version of linux. I am
ready to take part with you provided you do not have any issue.


On Mon, Oct 12, 2009 at 5:24 AM, Peter Williams <[email protected]> wrote:
> On 10/10/09 17:18, Pankaj Parakh wrote:
>>
>> ?Hi all,
>>
>> ?I want to add my scheduler in linux 2.6.25.3, which have modular
>> design, is there any document which can explain that modular design of
>> generic scheduler in detail. I wanted to try my scheduler.
>>
>> Any guidance..
>
> Not really an answer to you question but related: ?I'm resurrecting the CPU
> plug in scheduler project (to be renamed CPU_PISCH) which aims to provide an
> interface for people such as your self to implement CPU schedulers against
> and I was wondering if you were interested in adding your scheduler to this
> project? ?Or taking part in other ways?
>
> Thanks,
> Peter
> PS I'm currently working with respect to the latest kernel rather than
> 2.6.25.3 (in case that's an issue).
> --
> Peter Williams ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [email protected]
>
> "Learning, n. The kind of ignorance distinguishing the studious."
> ?-- Ambrose Bierce
>



--
Pankaj Parakh

2009-10-24 00:37:06

by Peter Williams

[permalink] [raw]
Subject: Re: How to add scheduler

On 24/10/09 01:10, Pankaj Parakh wrote:
> Hi Peter,
>
> Thanks for showing your interest, I am student and I am working on a
> project similar to yours i.e. to have a facility where in one can swap
> scheduler in run-time, but I am in very initial state of learning so I
> wanted to try a simple RR scheduler, objective of doing it is to learn
> about different interfaces in modular design(introduced from 2.6.23
> with CFS). I do not have any constraint with version of linux. I am
> ready to take part with you provided you do not have any issue.

No. That's good.

I've attached two patches which contain the work I've done so far. They
should be applied in the following order:

define_prelim_cpu_pisch_drv.patch
implement_spbrr_cpu_pisch_dvr.patch

and will result in two schedulers: the default CFS 'fair' (cfs_fair)
scheduler and a simple priority based round robin (spbrr) scheduler;
being available for selection at boot time and run time.

To select a scheduler at boot time just add 'cpu_pisch=cfs_fair' or
'cpu_pisch=spbrr' to the boot command line.

To select a scheduler at run time (as root) do:

echo -n 'cfs_fair' > /sys/kernel/cpu_pisch/name

or

echo -n 'spbrr' > /sys/kernel/cpu_pisch/name

The first step in adding your own scheduler would be to make a copy of
the file kernel/cpu_pisch_spbrr.c and then modify it. You will also
need to modify:

kernel/sched.c
kernel/cpu_pisch_drv.c
kernel/Kconfig.cpu_pisch

Hopefully, the required changes are obvious. If not don't hesitate to
ask questions. Also if you feel the need to modify the scheduler
interface (defined in include/linux/cpu_pisch_drv.h) feel free BUT think
very carefully about it and try not to make things too complex.

I am working on another scheduler (a simple entitlement based round
robin (sebrr) scheduler) which I hope to have finished before I publicly
release the patches.

If you wish to have your scheduler included just send it to me as a
patch which applies on top of the ones that I've attached.

Cheers
Peter
--
Peter Williams [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce


Attachments:
define_prelim_cpu_pisch_drv.patch (17.75 kB)
implement_spbrr_cpu_pisch_dvr.patch (7.41 kB)
Download all attachments

2009-10-27 07:37:50

by Pankaj Parakh

[permalink] [raw]
Subject: Re: How to add scheduler

On Sat, Oct 24, 2009 at 6:07 AM, Peter Williams <[email protected]> wrote:
> On 24/10/09 01:10, Pankaj Parakh wrote:
>>
>> Hi Peter,
>>
>> Thanks for showing your interest, I am student and I am working on a
>> project similar to yours i.e. to have a facility where in one can swap
>> scheduler in run-time, but I am in very initial state of learning so I
>> wanted to try a simple RR scheduler, objective of doing it is to learn
>> about different interfaces in modular design(introduced from 2.6.23
>> with CFS). I do not have any constraint with version of linux. I am
>> ready to take part with you provided you do not have any issue.
>
> No. ?That's good.
>
> I've attached two patches which contain the work I've done so far. ?They
> should be applied in the following order:
>
> define_prelim_cpu_pisch_drv.patch
> implement_spbrr_cpu_pisch_dvr.patch
>
> and will result in two schedulers: the default CFS 'fair' (cfs_fair)
> scheduler and a simple priority based round robin (spbrr) scheduler; being
> available for selection at boot time and run time.
>
> To select a scheduler at boot time just add 'cpu_pisch=cfs_fair' or
> 'cpu_pisch=spbrr' to the boot command line.
>
> To select a scheduler at run time (as root) do:
>
> echo -n 'cfs_fair' > /sys/kernel/cpu_pisch/name
>
> or
>
> echo -n 'spbrr' > /sys/kernel/cpu_pisch/name
>
> The first step in adding your own scheduler would be to make a copy of the
> file kernel/cpu_pisch_spbrr.c and then modify it. ?You will also need to
> modify:
>
> kernel/sched.c
> kernel/cpu_pisch_drv.c
> kernel/Kconfig.cpu_pisch
>
> Hopefully, the required changes are obvious. ?If not don't hesitate to ask
> questions. ?Also if you feel the need to modify the scheduler interface
> (defined in include/linux/cpu_pisch_drv.h) feel free BUT think very
> carefully about it and try not to make things too complex.
>
> I am working on another scheduler (a simple entitlement based round robin
> (sebrr) scheduler) which I hope to have finished before I publicly release
> the patches.
>
> If you wish to have your scheduler included just send it to me as a patch
> which applies on top of the ones that I've attached.
>
> Cheers
> Peter
> --
> Peter Williams ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [email protected]
>
> "Learning, n. The kind of ignorance distinguishing the studious."
> ?-- Ambrose Bierce
>

Hi Peter,

To which version of Linux Kernel should I apply the given patch.


--
Pankaj Parakh

2009-10-28 06:01:21

by Peter Williams

[permalink] [raw]
Subject: Re: How to add scheduler

On 27/10/09 17:30, Pankaj Parakh wrote:
> On Sat, Oct 24, 2009 at 6:07 AM, Peter Williams<[email protected]> wrote:
>> On 24/10/09 01:10, Pankaj Parakh wrote:
>>>
>>> Hi Peter,
>>>
>>> Thanks for showing your interest, I am student and I am working on a
>>> project similar to yours i.e. to have a facility where in one can swap
>>> scheduler in run-time, but I am in very initial state of learning so I
>>> wanted to try a simple RR scheduler, objective of doing it is to learn
>>> about different interfaces in modular design(introduced from 2.6.23
>>> with CFS). I do not have any constraint with version of linux. I am
>>> ready to take part with you provided you do not have any issue.
>>
>> No. That's good.
>>
>> I've attached two patches which contain the work I've done so far. They
>> should be applied in the following order:
>>
>> define_prelim_cpu_pisch_drv.patch
>> implement_spbrr_cpu_pisch_dvr.patch
>>
>> and will result in two schedulers: the default CFS 'fair' (cfs_fair)
>> scheduler and a simple priority based round robin (spbrr) scheduler; being
>> available for selection at boot time and run time.
>>
>> To select a scheduler at boot time just add 'cpu_pisch=cfs_fair' or
>> 'cpu_pisch=spbrr' to the boot command line.
>>
>> To select a scheduler at run time (as root) do:
>>
>> echo -n 'cfs_fair'> /sys/kernel/cpu_pisch/name
>>
>> or
>>
>> echo -n 'spbrr'> /sys/kernel/cpu_pisch/name
>>
>> The first step in adding your own scheduler would be to make a copy of the
>> file kernel/cpu_pisch_spbrr.c and then modify it. You will also need to
>> modify:
>>
>> kernel/sched.c
>> kernel/cpu_pisch_drv.c
>> kernel/Kconfig.cpu_pisch
>>
>> Hopefully, the required changes are obvious. If not don't hesitate to ask
>> questions. Also if you feel the need to modify the scheduler interface
>> (defined in include/linux/cpu_pisch_drv.h) feel free BUT think very
>> carefully about it and try not to make things too complex.
>>
>> I am working on another scheduler (a simple entitlement based round robin
>> (sebrr) scheduler) which I hope to have finished before I publicly release
>> the patches.
>>
>> If you wish to have your scheduler included just send it to me as a patch
>> which applies on top of the ones that I've attached.
>>
>> Cheers
>> Peter
>> --
>> Peter Williams [email protected]
>>
>> "Learning, n. The kind of ignorance distinguishing the studious."
>> -- Ambrose Bierce
>>
>
> Hi Peter,
>
> To which version of Linux Kernel should I apply the given patch.
>
>

Those patches were against 2.6.32-rc5 but they may also apply cleanly to
later versions.

--
Peter Williams [email protected]

"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce