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:
Conghui Chen
2020-02-05 14:51:43 +00:00
committed by wenlingz
parent 64b874ce4c
commit a7563cb9bd
6 changed files with 89 additions and 0 deletions

View File

@@ -55,6 +55,15 @@ config SCHED_IORR
IORR (IO sensitive Round Robin) scheduler supports multipule vCPUs running on
on one pCPU, and they will be scheduled by a IO sensitive round robin policy.
config SCHED_BVT
bool "BVT scheduler"
help
BVT (Borrowed Virtual time) is virtual time based scheduling algorithm, it
dispatching the runnable thread with the earliest effective virtual time.
TODO: BVT scheduler will be built on top of prioritized scheduling mechanism,
i.e. higher priority threads get scheduled first, and same priority tasks are
scheduled per BVT.
endchoice