Errors when enable SMP on l4android

Stefan Kalkowski stefan.kalkowski at ...1...
Thu Jun 11 10:24:51 CEST 2015


Hi,

On 06/10/2015 03:43 PM, li94575 wrote:
> Hi  everyone,
>     I have encountered some problems when enable SMP, which led l4android fails to start. There is an error happened in l4lx_task_create() from "ports-foc/src
> /lib/l4lx/l4lx_task.cc". The error message we got is " Inserting element 18... twice into avl tree! "
>     Through analysis we find the method " Linux::Irq_guard guard; " can only mask interrupts on current processor(vcpu0 or vcpu1), that means when vcpu0 is  executing the function l4lx_task_create, vcpu1 thread  can also enter this function. So, we should have a mutual lock here. The error will gone after adding
> a lock that genode provided, like this:
> 
> 
> static Genode::Lock  _lock_create;
> int l4lx_task_create(l4_cap_idx_t task_no)
> {
> using namespace L4lx;
> 
> 
> Linux::Irq_guard guard;
>         Genode::Lock::Guard  lock_guard(_lock_create);
> Env::env()->tasks()->insert(new (Genode::env()->heap()) Task(task_no));
> return 0;
> }
>    
>    Similar problem also arises in l4lx_task_delete_task(). I don't know if this is a good solution, do you have some better methods?  and are there any other interfaces 
> in l4lx library, whilch need to be considered mutual exclusive operation after enabling SMP?

Thank you very much for sharing this issue and solution with us!

I don't know a better solution than the one you provided. I've opened a
corresponding issue (#1574) on github, and will integrate a fixup into
the main-line repository.

Although we test L4Linux with two VCPUs every night, I cannot exclude
that we have other SMP issues like these within the l4lx support
library. The reason is that our test for L4Linux is not highly dynamic
like for instance the booting and using of Android. Beside of the
nightly test, we do not make much use of L4Linux at all. The only
comfort I can give to you is that most things that are done within the
l4lx support library are delegated to Genode services anyway and thereby
thread/vcpu safe. If you want to validate SMP safeness of the l4lx
library, it should be enough to concentrate on local datastructures used
within the library.

Sorry that I cannot assist you more, but to be honest L4Linux/L4Android
has not a high priority for our current workloads and daily scenarios,
and thereby is neglected.

Best regards
Stefan

>     Thanks a lot !
> 
> 
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
> 

-- 
Stefan Kalkowski
Genode Labs

http://www.genode-labs.com/ ยท http://genode.org/




More information about the users mailing list