trace: don't account argument_buffer 2x

The quota for the argument buffer is already accounted by using the
Attached_ram_dataspace _argument_buffer, which uses the Constraint_ram_allocator
_ram, which uses the Ram_quota_guard from the Session_object. Running on
Sculpt with more than 1000 Subject_info objects/trace IDs the memory
waste become noticeable.
This commit is contained in:
Alexander Boettcher 2020-09-01 14:01:57 +02:00 committed by Christian Helmuth
parent f70b02ae3b
commit 99bdfbe36f
2 changed files with 6 additions and 7 deletions

View File

@ -187,9 +187,7 @@ Session_component::Session_component(Rpc_entrypoint &ep,
_policies(policies),
_subjects(_subjects_slab, _ram, _sources),
_argument_buffer(_ram, local_rm, arg_buffer_size)
{
withdraw(Ram_quota{_argument_buffer.size()});
}
{ }
Session_component::~Session_component()

View File

@ -286,8 +286,8 @@ struct App::Main
PARENT_LEVELS = 0
};
size_t trace_ram_quota { 20 * 4096 };
size_t arg_buffer_ram { 10 * 4096 };
size_t arg_buffer_ram { 12 * 4096 }; /* ~ 190 trace Subject_info objects */
size_t trace_ram_quota { arg_buffer_ram + 4 * 4096 };
Reconstructible<Trace::Connection> _trace { _env,
trace_ram_quota,
@ -359,8 +359,9 @@ void App::Main::_handle_period()
return;
}
trace_ram_quota += 4096;
arg_buffer_ram += 4 * 4096;
enum { ARG_RAM_UPGRADE = 4 * 4096 };
trace_ram_quota += ARG_RAM_UPGRADE;
arg_buffer_ram += ARG_RAM_UPGRADE;
/* by destructing the session we free up the allocated memory in core */
Genode::warning("re-construct trace session");