Dear Genode community,
I want to dynamically create Region maps through an RM session (amount not known at compile time). If the RAM quota of the session exceedes, I want to upgrade the RAM quota of the session.
For this case I wrote a small test [1] which creates Region maps until an exception is thrown and I tried to catch it. I realized that the exception was thrown in another thread (core's entrypoint probably), meaning I cannot catch it in my test component's thread.
[1] https://github.com/702nADOS/genode-CheckpointRestore-SharedMemory/blob/0a78b...
For a better insight I logged the RAM quota consumption in Rm_session_component::create. The output of my test looks as follows:
[init -> rm_stresser] --- Rm-creation-stresser started --- [init -> rm_stresser] Round 0 Alloc avail: 49152 [init -> rm_stresser] Round 1 Alloc avail: 36864 [init -> rm_stresser] Round 2 Alloc avail: 24576 [init -> rm_stresser] Round 3 Alloc avail: 12288 [init -> rm_stresser] Round 4 Alloc avail: 0 [init -> rm_stresser] Round 5 Quota exceeded! amount=61440, size=8192, consumed=61440 Uncaught exception of type 'Genode::Allocator::Out_of_memory' Warning: abort called - thread: entrypoint
Is there an easy way to upgrade a session's RAM quota before allocating objects with no available RAM? If there is already a component in Genode which solves my problem, I would love to see the source code :)
Kind regards, Denis
Hi Denis,
Alloc avail: 0 [init -> rm_stresser] Round 5 Quota exceeded! amount=61440, size=8192, consumed=61440 Uncaught exception of type 'Genode::Allocator::Out_of_memory' Warning: abort called - thread: entrypoint
Is there an easy way to upgrade a session's RAM quota before allocating objects with no available RAM?
you did everything correctly. The problem is actually that core's RM service misses to catch the 'Allocator::Out_of_memory' exception. The attached patch rectifies this. In your test program, you need to catch 'Region_map::Out_of_metadata' instead of 'Allocator::Out_of_memory'. With this minor change, the test passes.
Thank you very much for pointing us to this problem and for the super-convenient test case! :-)
Cheers Norman
No problem, thanks for the fast answer and the patch :)
On 25.08.2016 16:32, Norman Feske wrote:
Hi Denis,
Alloc avail: 0 [init -> rm_stresser] Round 5 Quota exceeded! amount=61440, size=8192, consumed=61440 Uncaught exception of type 'Genode::Allocator::Out_of_memory' Warning: abort called - thread: entrypoint
Is there an easy way to upgrade a session's RAM quota before allocating objects with no available RAM?
you did everything correctly. The problem is actually that core's RM service misses to catch the 'Allocator::Out_of_memory' exception. The attached patch rectifies this. In your test program, you need to catch 'Region_map::Out_of_metadata' instead of 'Allocator::Out_of_memory'. With this minor change, the test passes.
Thank you very much for pointing us to this problem and for the super-convenient test case! :-)
Cheers Norman
genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main