mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
hv: clear NEED_RESCHEDULE flag in schedule
Now, need_reschedule will test_and_clear the bit NEED_RESCHEDULE in schedule context, then call schedule. It is not a exact match with the name. This patch move the flag clearing into scheudle, and need_reschedule just check and return. Tracked-On: #1821 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -45,7 +45,7 @@ void vcpu_thread(struct sched_object *obj)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (need_reschedule(vcpu->pcpu_id) != 0) {
|
||||
if (need_reschedule(vcpu->pcpu_id)) {
|
||||
/*
|
||||
* In extrem case, schedule() could return. Which
|
||||
* means the vcpu resume happens before schedule()
|
||||
@@ -95,7 +95,7 @@ void default_idle(__unused struct sched_object *obj)
|
||||
uint16_t pcpu_id = get_cpu_id();
|
||||
|
||||
while (1) {
|
||||
if (need_reschedule(pcpu_id) != 0) {
|
||||
if (need_reschedule(pcpu_id)) {
|
||||
schedule();
|
||||
} else if (need_offline(pcpu_id) != 0) {
|
||||
cpu_dead();
|
||||
|
||||
Reference in New Issue
Block a user