[LITMUS^RT] Problem with Litmus-RT plugin

Andrea Bastoni bastoni at sprg.uniroma2.it
Tue May 27 10:23:14 CEST 2014


Hi Evgeniy,

On Tue, May 27, 2014 at 9:33 AM, Evgeniy Veretennikov
<evg.veretennikov at gmail.com> wrote:
> Hello Andrea,
>
> I'm student of the Moscow Aviation Institute, and I develop Litmus-RT plugin
> which schedules processes like ARINC 653 scheduler schedules partitions
> (ARINC 653 is aviation standard). This is simple round-robin algorithm: each
> process has predefined runtime inside predefined period. My plugin is based
> on version 2012.2 as a demo plugin in this CreateAPluginTutorial:
> https://wiki.litmus-rt.org/litmus/CreateAPluginTutorial

Can I ask you why 2012.2 and not a more updated version?

> My plugin's function arinc_schedule(struct task_struct*) just chooses
> task_struct* of process which should run now and returns this pointer. So, I
> can successfully start my plugin ($ setsched ARINC), but when I start some
> RT-process (for example, $ rtspin 10 100 10), Ubuntu GUI freezes and virtual
> machine with Litmus uses 100% of all CPUs. I think, I should change process
> state or some queues inside arinc_schedule() function, but I don't know what
> exactly to do. I saw some queue-management in demo plugin, but I don't know
> how to use process queues, because my algorithm is just round-robin, either
> array, not a queue.

The Litmus RT infrastructure allows you to define the logic to select
the next task to be run, but is integrated in the linux-scheduler
infrastructure.

Although it should be relatively straightforward to define your own
scheduling policy (either ARINC o P-EDF, or G-EDF), you should make
sure you also understand the linux-scheduler infrastructure where
Litmus is "plugged-in".

To implement an A653 policy, I'd suggest you to start with a P-FP
plugin, understand its implementation, and then hack-in the
modification required to support your specific need. The data
structure you use to manage your tasks (provided that you adequately
protect them) are your specific plugin implementation details.

> Also I have such question: is it acceptable to use spinlock_irqsave() and
> spinlock_irqrestore() to have lock inside arinc_schedule()?

The spinlock (with/without irq saving) are the standard busy waiting
mechanism to protect your data structures against concurrent access in
the linux kernel. You should normally use them to protect the data
structures of your plugin against concurrent accesses, but the exact
logic depends on your implementation.

As a final note, please make sure you use the litmus ML for your
questions. The ML is the major discussion point for Litmus RT-related
questions.

Thanks,
- Andrea

>
> I hope for your help and will be glad to see your reply.
>
> Best regards,
> Evgeniy Veretennikov
> Student of the Moscow Aviation Institute




More information about the litmus-dev mailing list