From a9b2d9bdc64ceceedeec30bd7abc4b069b10c2d2 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 3 Sep 2024 16:35:54 +0200 Subject: [PATCH] gui_session: adjust session quota for wm scenarios The current default session RAM quota of 36 KiB reflects the needs of the nitpicker GUI server. However, in most commonly used scenarios, a GUI client connects to nitpicker indirectly via the wm. The low value worked so far because the wm did not account RAM and cap usage per client so far but paid out of its own pocket and faithfully forwarded all resource upgrades to nitpicker. When adding resource accounting to the wm, the old default value has the effect that a new client has to repeatedly attempt the session creation - each time offering sligthly more session quota - until both nitpicker and the wm are satisfied. By roughly doubling the default to 80 KiB, a wm client immediately succeeds with opening a GUI session without repeated attempts. By specifying a custom 'cap_quota' amount to the 'Genode::Connection', the Gui::Connection now donates enough caps for both the wm and nitpicker. Issue #5340 --- .../recipes/raw/themed_wm/decorator_init.config | 4 ++-- repos/os/include/gui_session/connection.h | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/repos/gems/recipes/raw/themed_wm/decorator_init.config b/repos/gems/recipes/raw/themed_wm/decorator_init.config index efe0bec858..9e8bf6b7ca 100644 --- a/repos/gems/recipes/raw/themed_wm/decorator_init.config +++ b/repos/gems/recipes/raw/themed_wm/decorator_init.config @@ -8,9 +8,9 @@ - + - + diff --git a/repos/os/include/gui_session/connection.h b/repos/os/include/gui_session/connection.h index aa59a615b1..5116568f34 100644 --- a/repos/os/include/gui_session/connection.h +++ b/repos/os/include/gui_session/connection.h @@ -41,6 +41,17 @@ class Gui::Connection : private Genode::Connection Ram_quota _ram_quota { }; /* session quota donated for virtual frame buffer */ + /* + * Session quota at the construction time of the connection + * + * The 'Gui::Session::CAP_QUOTA' value is based the needs of the + * nitpicker GUI server. To accommodate the common case where a client + * is served by the wm, which in turn wraps a nitpicker session, extend + * the session quota according to the needs of the wm. + */ + static constexpr Ram_quota _RAM_QUOTA { 96*1024 }; + static constexpr Cap_quota _CAP_QUOTA { Session::CAP_QUOTA + 9 }; + public: View_ids view_ids { }; @@ -65,7 +76,8 @@ class Gui::Connection : private Genode::Connection */ Connection(Env &env, Session_label const &label = { }) : - Genode::Connection(env, label, Ram_quota { 36*1024 }, Args()), + Genode::Connection(env, label, _RAM_QUOTA, _CAP_QUOTA, + Affinity { }, Args { }), _env(env) { }