Dear All,
after playing around with the demo scenario and launchpad a bit, Genode exited with an error message:
"virtual bool Genode::Sliced_heap::alloc(Genode::size_t, void**): Could not allocate dataspace with size 4096". More details on the setup below. The more memory is "left for core" (see comment before the lines in main.cc), the later this error message occurs. Is there any other possibility to avoid this behavior than increasing memory "left for core"? Or am I doing something wrong?
Thanks,
Matthias
The setup was as follows:
- Checked out Genode tags/10.05
- Set up demo scenario for Linux (used the provided config and build.config files)
- Changed base/src/core/main.cc as follows (svn diff: )
Index: base/src/core/main.cc
===================================================================
--- base/src/core/main.cc (revision 131)
+++ base/src/core/main.cc (working copy)
@@ -214,7 +214,8 @@
Ram_session_client(init_ram_session_cap).ref_account(env()->ram_session_cap());
/* transfer all left memory to init, but leave 1 MB left for core */
- size_t init_quota = platform()->ram_alloc()->avail() - 2*1024*1024;
+ /* Test with less mem for core */
+ size_t init_quota = platform()->ram_alloc()->avail() - 100*1024;
env()->ram_session()->transfer_quota(init_ram_session_cap, init_quota);
PDBG("transferred %zd MB to init", init_quota / (1024*1024));
(i.e., reduced the available quota to core (drastically))
- started ./bin/core with the provided example config
- started launchpad application
- started and stopped liquid_fb several times, after about 7 times, the following error
occurs and Genode crashes:
[init -> scout -> launchpad] starting liquid_fb with quota 7340032
[init -> scout -> launchpad] using unique child name "liquid_fb"
virtual Genode::Ram_dataspace_capability
Genode::Ram_session_component::alloc(Genode::size_t): quota exceeded!
virtual Genode::Ram_dataspace_capability
Genode::Ram_session_component::alloc(Genode::size_t): memory for slab:
9216
virtual Genode::Ram_dataspace_capability
Genode::Ram_session_component::alloc(Genode::size_t): used quota:
296080
virtual Genode::Ram_dataspace_capability
Genode::Ram_session_component::alloc(Genode::size_t): ds_size:
4096
virtual Genode::Ram_dataspace_capability
Genode::Ram_session_component::alloc(Genode::size_t):
sizeof(Ram_session_component): 144
virtual Genode::Ram_dataspace_capability
Genode::Ram_session_component::alloc(Genode::size_t): quota_limit:
300032
virtual bool Genode::Sliced_heap::alloc(Genode::size_t, void**): Could not
allocate dataspace with size 4096
--
Matthias Gerlach
OpenSynergy GmbH
Rotherstr. 9, 10245 Berlin
Telefon: +49 (30) 20 1818 35-45
Fax: +49 (30) 20 1818 35-02
EMail: Matthias.Gerlach@...24...
www.opensynergy.com
Handelsregister: Amtsgericht Charlottenburg, HRB 108616B
Geschäftsführer: Frank-Peter Böhm, Rolf Morich, Stefaan Sonck Thiebaut
Hi Matthias,
after playing around with the demo scenario and launchpad a bit, Genode exited with an error message:
“virtual bool Genode::Sliced_heap::alloc(Genode::size_t, void**): Could not allocate dataspace with size 4096”. More details on the setup below. The more memory is “left for core” (see comment before the lines in main.cc), the later this error message occurs. Is there any other possibility to avoid this behavior than increasing memory “left for core”? Or am I doing something wrong?
the observed behaviour stems from missing resource accounting for some core services, most particularly the regions allocated by RM sessions.
In principle, Genode provides a mechanism for a client to lend memory quota to a server during the use of a session. The concept is meant to enable a server to use resources provided by the client only. However, in core, not all services make use of this feature yet. For example, the RM service for managing address spaces receives a quota donation of 4K but the actual memory usage depends on how many regions are attached to the RM session. A client that uses a lot of regions will consumes unaccounted core memory, resulting in the effect that you observed. To solve this issue, the RM session must restrict the number of regions according to the RAM quota supplied by the client.
This is a known limitation, which is certainly on our list of things to improve. It is not terribly hard to fix but until know, the work-around of supplying some slack quota to core sufficed for our use cases. In a production system, this issue should be fixed - and, if Genode is used in such a setting, will do so, of course. :-)
Cheers Norman