mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
hv: sched_bvt: add BVT scheduler
BVT (Borrowed virtual time) scheduler is used to schedule vCPUs on pCPU.
It has the concept of virtual time, vCPU with earliset virtual time is
dispatched first.
Main concepts:
tick timer:
a period tick is used to measure the physcial time in units of MCU
(minimum charing unit).
runqueue:
thread in the runqueue is ordered by virtual time.
weight:
each thread receives a share of the pCPU in proportion to its
weight.
context switch allowance:
the physcial time by which the current thread is allowed to advance
beyond the next runnable thread.
warp:
a thread with warp enabled will have a change to minus a value (Wi)
from virtual time to achieve higher priority.
virtual time:
AVT: actual virtual time, advance in proportional to weight.
EVT: effective virtual time.
EVT <- AVT - ( warp ? Wi : 0 )
SVT: scheduler virtual time, the minimum AVT in the runqueue.
Tracked-On: #4410
Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -90,6 +90,12 @@ struct sched_iorr_control {
|
||||
struct hv_timer tick_timer;
|
||||
};
|
||||
|
||||
extern struct acrn_scheduler sched_bvt;
|
||||
struct sched_bvt_control {
|
||||
struct list_head runqueue;
|
||||
struct hv_timer tick_timer;
|
||||
};
|
||||
|
||||
bool is_idle_thread(const struct thread_object *obj);
|
||||
uint16_t sched_get_pcpuid(const struct thread_object *obj);
|
||||
struct thread_object *sched_get_current(uint16_t pcpu_id);
|
||||
|
||||
Reference in New Issue
Block a user