mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-14 13:18:19 +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
@ -24,8 +24,8 @@ namespace Genode {
|
||||
explicit Linux_cpu_session_client(Capability<Linux_cpu_session> session)
|
||||
: Rpc_client<Linux_cpu_session>(session) { }
|
||||
|
||||
Thread_capability create_thread(size_t, Name const &name, addr_t utcb = 0) {
|
||||
return call<Rpc_create_thread>(0, name, utcb); }
|
||||
Thread_capability create_thread(size_t weight, Name const &name, addr_t utcb = 0) {
|
||||
return call<Rpc_create_thread>(weight, name, utcb); }
|
||||
|
||||
Ram_dataspace_capability utcb(Thread_capability thread) {
|
||||
return call<Rpc_utcb>(thread); }
|
||||
@ -84,9 +84,7 @@ namespace Genode {
|
||||
int transfer_quota(Cpu_session_capability session, size_t amount) {
|
||||
return call<Rpc_transfer_quota>(session, amount); }
|
||||
|
||||
size_t quota() { return call<Rpc_quota>(); }
|
||||
|
||||
size_t used() { return call<Rpc_used>(); }
|
||||
Quota quota() override { return call<Rpc_quota>(); }
|
||||
|
||||
/*****************************
|
||||
* Linux-specific extension **
|
||||
|
Reference in New Issue
Block a user