2013-04-05 17:54:39

by Lucas De Marchi

[permalink] [raw]
Subject: Re: control on cpu/core

On Fri, Apr 5, 2013 at 1:30 PM, christophe malvasio <[email protected]> wrote:
> hi all
> i want to give the control of one core to a module
> that is the kernel have to not schedule/interrupt execution on this
> core and also my module have to be the only thing to send execution on
> this core
> i'm not sure if i can make it only from my module or if i must hack
> the kernel too ?
> fake core unplug or more coding ?
> give me your opinion ;)

You can isolate a core during boot so no process is scheduled to that
core. See "isolcpus=" in Documentation/kernel-parameters.txt.

I don't know what your module is doing so it might not be possible in
all scenarios. The only way I see is if your module created a kernel
thread. Then it can be moved to the isolated core by setting the cpu
mask. See for example how kworker, watchdog, migration do.

I'm CCing LKML to broaden your audience. [email protected]
is really low traffic and mostly intended for the module
loading/removal process, not really about writing modules.


Lucas De Marchi


2013-04-05 18:41:15

by christophe malvasio

[permalink] [raw]
Subject: Re: control on cpu/core

ok thanks lucas ;)
i'm not on writing functions loading yet but it will come
(i don't have a more efficient format than elf in good shape in my mind ...)


2013/4/5 Lucas De Marchi <[email protected]>:
> On Fri, Apr 5, 2013 at 1:30 PM, christophe malvasio <[email protected]> wrote:
>> hi all
>> i want to give the control of one core to a module
>> that is the kernel have to not schedule/interrupt execution on this
>> core and also my module have to be the only thing to send execution on
>> this core
>> i'm not sure if i can make it only from my module or if i must hack
>> the kernel too ?
>> fake core unplug or more coding ?
>> give me your opinion ;)
>
> You can isolate a core during boot so no process is scheduled to that
> core. See "isolcpus=" in Documentation/kernel-parameters.txt.
>
> I don't know what your module is doing so it might not be possible in
> all scenarios. The only way I see is if your module created a kernel
> thread. Then it can be moved to the isolated core by setting the cpu
> mask. See for example how kworker, watchdog, migration do.
>
> I'm CCing LKML to broaden your audience. [email protected]
> is really low traffic and mostly intended for the module
> loading/removal process, not really about writing modules.
>
>
> Lucas De Marchi