[LITMUS^RT] sched_demo tutorial out of date

Chen, Tianyang tiche at seas.upenn.edu
Thu Dec 22 07:02:46 CET 2016


Hi,

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
...

Can someone point me to the right direction?

Thanks,
Tianyang Chen




More information about the litmus-dev mailing list