mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
add priorities for vgpus
This commit is contained in:
@@ -39,7 +39,7 @@ void CompletlyFair::removeVGPU(VGpu* vgpu)
|
||||
VGpu* CompletlyFair::nextVGPU()
|
||||
{
|
||||
// update cfs entry
|
||||
_curr->runtime += rdtsc() - _curr->ts;
|
||||
_curr->runtime += (rdtsc() - _curr->ts) * -_curr->vgpu->getPriority();
|
||||
|
||||
// list empty?
|
||||
if(_run_list.empty())
|
||||
|
||||
@@ -22,11 +22,34 @@ namespace gpgpu_virt {
|
||||
/// list of gpgpu tasks for this vpgu
|
||||
Genode::Fifo<Kernel> ready_list;
|
||||
|
||||
/// priority of vgpu
|
||||
int prio;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new VGpu object
|
||||
*/
|
||||
VGpu() : ctx(nullptr), ready_list() {}
|
||||
VGpu() : ctx(nullptr), ready_list(), prio(-1) {}
|
||||
|
||||
/**
|
||||
* @brief Set the Priority
|
||||
*
|
||||
* @param p
|
||||
*/
|
||||
void setPriority(int p)
|
||||
{
|
||||
prio = p;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Priority
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int getPriority()
|
||||
{
|
||||
return prio;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add a kernel to the vGPU's ready list
|
||||
|
||||
Reference in New Issue
Block a user