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

@@ -28,12 +28,14 @@ struct sched_object {
};
struct sched_context {
uint64_t flags;
uint64_t mwait_flags;
uint64_t rserved[6];
spinlock_t runqueue_lock;
struct list_head runqueue;
uint64_t flags;
struct sched_object *curr_obj;
spinlock_t scheduler_lock;
};
} __aligned(64);
void init_scheduler(void);
void switch_to_idle(run_thread_t idle_thread);