A question regarding thread creation in L4Linux.

2013-01-30 Thread Сергей Грехов
Hello to everyone!
The question is about method l4lx_thread_create() from 
ports-foc/src/lib/l4lx/l4lx_thread.cc.
According to the thread creation procedure in L4lx library, the pointer to VCPU 
instances are saved in a static array
   static L4lx::Vcpu* vcpus[L4LX_THREAD_NO_THREADS];
The index within this array is defined by passing UTCB address to function 
thread_id(). Now, if enable SMP and set two VCPUs, one can see the following 
strange thing:

//creating cpu0
l4lx_thread_create: (vc->utcb() = 44000400) thread_id() = 0002 TID = 
00011000
//everything is fine: pointer to Vcpu instance is saved under id=2

//creating timer
l4lx_thread_create: (vc->utcb() = 44000600) thread_id() = 0001 TID = 
00015000
//everything is fine here too: pointer to Vcpu instance is saved under id=1

//creating cpu1
l4lx_thread_create: (vc->utcb() = 44000800) thread_id() = 0002 TID = 
00019000
//something weird is happening here: pointer to Vcpu instance is saved under 
id=2, previous pointer is lost.

Looking inside thread_id() one can find that it uses utcb_base_addr() [which is 
equal to l4_utcb()] to calculate required index in array. Is it a bug? Should 
not the utcb_base_addr() be something similar to following expression:
(Genode::Native_config::context_area_virtual_base() + 
THREAD_MAX * Genode::Native_config::context_virtual_size()) ?

-- 
Best regards,
Sergey S. Grekhov

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Genode-main mailing list
Genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main


Re: Genode + panda es (rev-b2),

2012-11-19 Thread Сергей Грехов

> 4. While probably not related to genode, does anyone know how I can
> get the reset button on the pandaboard to work properly? Right now it
> looks like it resets the board, but U-boot does not come back up
> again. I'm currently using the precompiled version from your
> repository.

For some (yet, unknown) reasons, reset on Pandaboard ES is working properly 
only for some models of SD cards. Try to use some other SD cards: we found that 
with Kingmax 4Gb SDHC reset button works properly and, for example, with 
Transcend 4Gb SDHC does not work (U-boot does not come back up again).


-- 
Best regards,
Sergey S. Grekhov

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Genode-main mailing list
Genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main


Re: Influence of application priority on IPC

2012-11-12 Thread Сергей Грехов
Hello, Mr. Norman Feske and Mr. Alexander Boettcher!

Thank you very much for the complete answer.
My use case is quite simple: I tried to start several L4Linux instances and 
want them to have network available.
The environment of the use case: Pandaboard, Fiasco.OC (revision 38).

In order to provide network I use nic_bridge multiplexer which share “Nic” 
service provided by usb_drv driver. When I set priority of usb_drv to "-1" and 
priority of nic_bridge to default value, everything works fine. But if I set 
both priorities to default values, most of L4Linux instances do not obtain IP 
addresses through DHCP. 
Also, it was noticed that:
even in case of obtaining the IP address, after some time of intensive usage of 
network, the connection becomes unavailable, as well as “Nic” service provided 
by nic_bridge
if in the previous case the network is not used intensively, the “ping” detects 
(from time to time) unreachable network of the L4Linux instance (with obtained 
IP address)

According to provided info there is a hypothesis about issue with nic_bridge. 
As long as this multiplexer plays both client and server roles, the problem 
occurs when usb_drv tries to get something from nic_bridge. 
The problem with priority="-1" for usb_drv is that there is a strange delay 
when closing network connection. Setting both priorities to default value 
solves this problem, but also creates a bigger one: network is unavailable on 
most L4Linux instances.

Kind regards,
Sergey.

12.11.2012, 13:28, "Norman Feske" :
> Hi Sergey,
>
>>  I have a question about influence of application priority on IPC
>>  messaging mechanism.
>
> your concern of the interaction of priorities and IPC are spot-on. This
> is a topic where the different microkernels differ significantly.
> Generally, static priorities should be used with caution. You need to be
> aware that a higher-priority thread can starve any lower-priority
> activity in the system by a busy loop. The potential problems become
> apparent when having more than two parties in the system. In such
> scenarios, priority inversion can occur.
>
>>  Let's say I have two applications (client and server) which use IPC for
>>  communication with each other. In run script I set the priority of
>>  client to default value (no priority specified) and the priority of
>>  server to -1 (value of prio_levels is equal to 2).
>
> Assigning a lower priority to the server than to the client is a
> classical priority inversion problem. The client has a high priority and
> wants the server to do some work for him. But because the server has a
> low priority, any other thread that has a higher priority than the
> server (but possibly a lower priority than the client) can infinitely
> delay the execution of the server.
>
> There are two ways to deals with such problems, namely priority
> inheritance and priority ceiling.
>
> Priority inheritance means that the server will inherit the (higher)
> priority of the client while doing work for the client. So the priority
> is not attached to a thread but rather to a specific work topic. Anyone
> that contributes to the work gets the high priority regardless of which
> processes the execution flows through. As far as I know, NOVA is the
> only kernel of the Genode base platforms that properly implements
> priority inheritance.
>
> Priority ceiling means that there exists a strict order of priorities
> that is consistent with the client-server relationships of processes. A
> server always needs to have a priority at least as high as its clients.
> Because of the invariant that the server operates at a higher priority
> than the client, the service request will make progress in at least any
> situation where the client would make progress (because it is scheduled
> at least as likely as the client who is currently blocked). The
> disadvantage of priority ceiling is that a client can artificially boost
> its priority (and cause system load) by using servers.
>
> Priority ceiling can be implemented on L4/Fiasco, OKL4, Fiasco.OC, and
> L4ka::Pistachio.
>
>>  The question is quite simple: is there any determined dependency between
>>  changing the priority of applications and possible collisions of IPC
>>  calls? For example, what if both priorities are set to default values or
>>  to -1? And if there is a suspect of lost IPC messages, then how this
>>  hypothesis can be checked?
>
> Normally, one would expect that priority inversion problems are easy to
> detect because some part of the system just freezes. However, on most
> kernels that lack priority inheritance (actually all kernels but NOVA),
> the bad interaction between IPC and priorities are hard to detect
> because of an optimization called time-slice donation. On those kernels,
> the client that calls the server lends its remaining time slice to the
> server to boost the processing of its IPC request. This way, the flow of
> control will typically go from the client through the server and then
> bac

Trouble with QEMU when running run/demo on branch 12.05

2012-08-01 Thread Сергей Грехов
Hello to all!
I have switched on commit daf4300 and tried to run demo with command "make 
run/demo".
The output gives no error, but for some reason qemu shows only black screen. I 
tried to use qemu provided by Ubuntu (0.15.1) and tried to compile version 
0.14.1 with SDL support - the result is the same - black screen.

The emulated system is foc_pbxa9.

Command "make run/demo" works fine on tag 12.05. So I guess that the problem is 
in some commit between b54bdea and daf4300.

-- 
Best regards,
Sergey S. Grekhov

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Genode-main mailing list
Genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main