HV: Use the mwait instead of pause for cpu_idle

Now it will use the pause when cpu is in idle state. It will consume
more power. If the mwait is supported, it will use the monitor/mwait to
enter the deep CPU C-state. It helps to save power.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
Zhao Yakui
2019-08-27 16:25:39 +08:00
parent 21bd1c8bd3
commit a7706e0c39
4 changed files with 49 additions and 17 deletions

View File

@@ -92,9 +92,7 @@ void default_idle(__unused struct sched_object *obj)
} else if (need_shutdown_vm(pcpu_id)) {
shutdown_vm_from_idle(pcpu_id);
} else {
CPU_IRQ_ENABLE();
cpu_do_idle();
CPU_IRQ_DISABLE();
}
}
}