diff --git a/repos/dde_uos-intel-gpgpu/src/virt/strategies/cfs.cc b/repos/dde_uos-intel-gpgpu/src/virt/strategies/cfs.cc index 9e7b480252..cf9d2e2757 100644 --- a/repos/dde_uos-intel-gpgpu/src/virt/strategies/cfs.cc +++ b/repos/dde_uos-intel-gpgpu/src/virt/strategies/cfs.cc @@ -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()) diff --git a/repos/dde_uos-intel-gpgpu/src/virt/vgpu.h b/repos/dde_uos-intel-gpgpu/src/virt/vgpu.h index 74ec851327..2ecdaa3311 100644 --- a/repos/dde_uos-intel-gpgpu/src/virt/vgpu.h +++ b/repos/dde_uos-intel-gpgpu/src/virt/vgpu.h @@ -22,11 +22,34 @@ namespace gpgpu_virt { /// list of gpgpu tasks for this vpgu Genode::Fifo 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