[LITMUS^RT] workload-generator: available cpus using GSN-EDF

Björn Brandenburg bbb at mpi-sws.org
Sat Jan 27 18:19:44 CET 2018


> On 25. Jan 2018, at 17:12, Benjamin Fischer <benjamin.f.fischer at fau.de> wrote:
> 
> I have a question related to the generated shell scripts for the GSN-EDF scheduler plugin which have been created by mktasks.py. Using mktasks.py to generate tasksets I'm able to select the number of cores I want this taskset to be genereated with whereas the generated shell script for this taskset will take account of all available cores on the machine.

Yes, this is expected.

> For example: I've created a taskset with two cores, 100 tasks and 50% utilization and executed it on a machine with four available cores, so the tasks have been executed on all four cores instead of the desired number of two.

Under a global scheduler, all cores will be used. If you want to impose restrictions on which cores a task can run, you need an arbitrary processor affinity (APA) scheduler. 

In LITMUS^RT, no such scheduler is currently available (but see https://people.mpi-sws.org/~bbb/papers/pdf/ecrts16v.pdf if you really need one). 

> In my case, I would like to only use the number of cores specified by the key-value-encoding of the current shell script. Is there a proper way to achieve this?

In the base, we’ve achieved this by booting the machine with maxcpus (the Linux kernel command line parameter that allows restricting the number of CPUs that the kernel will initialize during bootup) set to the desired number of cores.

> I thought of enabling/disabling the desired number of cores via 'echo {0,1}         > /sys/devices/system/cpu/cpuX/online' before running the script. I tried this for my little example and overheads only have been recorded on two cores, but I don't know if this solution is sufficient for my problem. 

Technically, LITMUS^RT doesn’t support CPU hot-plugging. If you do this while the plugin is active, it will most likely crash or malfunction. 

If you do it *before* activating the plugin, you may get lucky, but I’ve never tested this.

- Björn




More information about the litmus-dev mailing list