mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-21 16:39:39 +00:00
CPU session: apply quota via relative weightings
Physical CPU quota was previously given to a thread on construction only by directly specifying a percentage of the quota of the according CPU session. Now, a new thread is given a weighting that can be any value. The physical counter-value of such a weighting depends on the weightings of the other threads at the CPU session. Thus, the physical quota of all threads of a CPU session must be updated when a weighting is added or removed. This is each time the session creates or destroys a thread. This commit also adapts the "cpu_quota" test in base-hw accordingly. Ref #1464
This commit is contained in:
committed by
Christian Helmuth
parent
955977b516
commit
c9272937e7
4
repos/base-linux/src/base/env/platform_env.h
vendored
4
repos/base-linux/src/base/env/platform_env.h
vendored
@ -44,10 +44,10 @@ struct Genode::Expanding_cpu_session_client
|
||||
Expanding_cpu_session_client(Genode::Capability<Linux_cpu_session> cap)
|
||||
: Upgradeable_client<Genode::Linux_cpu_session_client>(cap) { }
|
||||
|
||||
Thread_capability create_thread(size_t, Name const &name, addr_t utcb)
|
||||
Thread_capability create_thread(size_t weight, Name const &name, addr_t utcb)
|
||||
{
|
||||
return retry<Cpu_session::Out_of_metadata>(
|
||||
[&] () { return Linux_cpu_session_client::create_thread(0, name, utcb); },
|
||||
[&] () { return Linux_cpu_session_client::create_thread(weight, name, utcb); },
|
||||
[&] () { upgrade_ram(8*1024); });
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user