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:
Shuo A Liu
2018-12-25 14:48:17 +08:00
committed by wenlingz
parent e8ac97671f
commit a0154223f6
3 changed files with 10 additions and 9 deletions

View File

@@ -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();