From ea9c2199e853d97dc30790c62868efeaf9cf2902 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 2 Apr 2015 11:26:27 +0200 Subject: [PATCH] base: extend emergency dataspace size The emergency dataspace is used to accommodate the corner case where a signal context capability is created while issuing the first resource request. Normally, the attempt to upgrade the signal-session quota under such a constrained situation would fail. By freeing the emergency dataspace in this situation, we regain enough quota to upgrade the signal session. This is a follow up commit for "base: Raise RAM quota of signal session to 16K" and fixes the resource_request test on 64-bit platforms. --- repos/base-linux/src/base/env/platform_env.h | 2 +- repos/base/src/base/env/platform_env.h | 2 +- repos/base/src/base/signal/signal.cc | 1 + repos/os/src/test/resource_request/main.cc | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/repos/base-linux/src/base/env/platform_env.h b/repos/base-linux/src/base/env/platform_env.h index ca8f2ce3bd..089a7373bb 100644 --- a/repos/base-linux/src/base/env/platform_env.h +++ b/repos/base-linux/src/base/env/platform_env.h @@ -412,7 +412,7 @@ namespace Genode { * * See the comment of '_fallback_sig_cap()' in 'env/env.cc'. */ - constexpr static size_t _emergency_ram_size() { return 4*1024; } + constexpr static size_t _emergency_ram_size() { return 8*1024; } Ram_dataspace_capability _emergency_ram_ds; diff --git a/repos/base/src/base/env/platform_env.h b/repos/base/src/base/env/platform_env.h index 47178969b9..dcfa32ac93 100644 --- a/repos/base/src/base/env/platform_env.h +++ b/repos/base/src/base/env/platform_env.h @@ -97,7 +97,7 @@ class Genode::Platform_env : public Genode::Env, public Emergency_ram_reserve * * See the comment of '_fallback_sig_cap()' in 'env/env.cc'. */ - constexpr static size_t _emergency_ram_size() { return 4*1024; } + constexpr static size_t _emergency_ram_size() { return 8*1024; } Ram_dataspace_capability _emergency_ram_ds; public: diff --git a/repos/base/src/base/signal/signal.cc b/repos/base/src/base/signal/signal.cc index 567b2438a4..31ba96fef1 100644 --- a/repos/base/src/base/signal/signal.cc +++ b/repos/base/src/base/signal/signal.cc @@ -230,6 +230,7 @@ void Signal_context::submit(unsigned num) Signal_connection * Signal_transmitter::connection() { return signal_connection(); } + /********************* ** Signal receiver ** *********************/ diff --git a/repos/os/src/test/resource_request/main.cc b/repos/os/src/test/resource_request/main.cc index ade029d57d..d48645aeb1 100644 --- a/repos/os/src/test/resource_request/main.cc +++ b/repos/os/src/test/resource_request/main.cc @@ -67,6 +67,9 @@ int main(int argc, char **argv) * successively upgrade the session. At one point, we will run out of our * initial quota. Now, before we can issue another upgrade, we first need * to request additional resources. + * + * Note that the construction of the signal receiver will consume a part + * of the quota we preserved as 'KEEP_QUOTA'. */ printf("\n-- draining signal session --\n"); {