[LITMUS^RT] sched_demo tutorial out of date

Björn Brandenburg bbb at mpi-sws.org
Thu Dec 22 11:03:23 CET 2016


> On 22 Dec 2016, at 07:02, Chen, Tianyang <tiche at seas.upenn.edu> wrote:
> I'm trying out Litmus-rt recently and found that the tutorial for the DEMO scheduler is a bit out-of-date regarding linux kernel 4.1.3.
> 
> In step 4 the __get_cpu_var() Macro is no longer available so I replaced it with get_cpu_var().
> 
> In step 5 where the main scheduling logic is added, is_running() cannot be found. I assume it checks if prev is running so I replaced it with is_current_running().
> 
> It compiles but crashes as soon as I switch to the DEMO scheduler. I managed to get some useful debugging message out of /dev/litmus/log and I can see the following:
> 
> 1 P2 [__do_plugin_switch at litmus/litmus.c:463]: deactivating plugin Linux
> 2 P2 [__do_plugin_switch at litmus/litmus.c:468]: activating plugin DEMO
> 3 P2 [demo_activate_plugin at litmus/sched_demo.c:187]: Initializing CPU0...
> 4 P2 [demo_activate_plugin at litmus/sched_demo.c:187]: Initializing CPU1...
> 5 P2 [demo_activate_plugin at litmus/sched_demo.c:187]: Initializing CPU2...
> 6 P2 [demo_activate_plugin at litmus/sched_demo.c:187]: Initializing CPU3...
> 7 P2 [vprintk_emit at kernel/printk/printk.c:1690]: Switching to LITMUS^RT plugin DEMO.
> 8 P2 [__do_plugin_switch at litmus/litmus.c:481]: do_plugin_switch() => 0
> 9 P1 [vprintk_emit at kernel/printk/printk.c:1690]: ------------[ cut here ]------------
> 10 P1 [vprintk_emit at kernel/printk/printk.c:1690]: WARNING: CPU: 1 PID: 13 at kernel/stop_machine.+++c:482 cpu_stopper_thread+0x122/0x130()
> 11 P1 [vprintk_emit at kernel/printk/printk.c:1690]: cpu_stop: migration_cpu_stop(ffff880000037e40)    leaked preempt count
> 12 P2 [vprintk_emit at kernel/printk/printk.c:1690]: BUG: scheduling while atomic: setsched/2042/0x00000002
> ...

Yes, the tutorial is unfortunately still out of date and needs to be updated to reflect the changes in the current kernel version. This is not that difficult, but takes some time (which I don’t have at the moment). 

@UNC: updating the tutorial would be a quite helpful contribution that doesn’t require that much expertise. I really would appreciate if someone would volunteer to help improve and maintain the available documentation, starting with the tutorial.

Thanks,
Björn

PS: Tianyang, please sign up for the LITMUS^RT mailing list. Non-member posts are usually rejected due to spam issues.






More information about the litmus-dev mailing list