acrn-hypervisor/hypervisor/common
Conghui 51e6dc5864 hv: sched: fix bug when reboot vm
BVT schedule rule:
When a new thread is wakeup and added to runqueue, it will get the
smallest avt (svt) from runqueue to initiate its avt. If the svt is
smaller than it's avt, it will keep the original avt. With the svt, it
can prevent a thread from claiming an excessive share of CPU after
sleepting for a long time.

For the reboot issue, when the VM is reboot, it means a new vcpu thread
is wakeup, but at this time, the Service VM's vcpu thread is blocked,
and removed from the runqueue, and the runqueue is empty, so the svt is
0. The new vcpu thread will get avt=0. avt=0 means very high priority,
and can run for a very long time until it catch up with other thread's
avt in runqueue.
At this time, when Service VM's vcpu thread wakeup, it will check the
svt, but the svt is very small, so will not update it's avt according to
the rule, thus has a very low priority and cannot be scheduled.

To fix it, update svt in pick_next handler to make sure svt is align
with the avt of the first obj in runqueue.

Tracked-On: #7944
Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2022-08-05 02:39:54 +08:00
..
delay.c hv/mod_timer: separate delay functions from the timer module 2021-05-18 16:43:28 +08:00
efi_mmap.c HV: fix build issue on RELEASE version 2021-11-16 19:01:44 +08:00
event.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
hv_main.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
hypercall.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
irq.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
ptdev.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
sched_bvt.c hv: sched: fix bug when reboot vm 2022-08-05 02:39:54 +08:00
sched_iorr.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
sched_noop.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
sched_prio.c hv: add priority based scheduler 2021-09-24 09:32:18 +08:00
schedule.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
softirq.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
ticks.c hv/mod_timer: split tsc handling code from timer. 2021-05-18 16:43:28 +08:00
timer.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
trusty_hypercall.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vm_load.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00