Skip to content

Commit b32ae22

Browse files
Shuo A Liuwenlingz
authored andcommitted
hv: sched: use hypervisor configuration to choose scheduler
For now, we set NOOP scheduler as default. User can choose IORR scheduler as needed. Tracked-On: #4178 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 6a144e6 commit b32ae22

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

hypervisor/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,12 @@ HW_C_SRCS += arch/x86/cat.c
211211
HW_C_SRCS += arch/x86/sgx.c
212212
HW_C_SRCS += common/softirq.c
213213
HW_C_SRCS += common/schedule.c
214+
ifeq ($(CONFIG_SCHED_NOOP),y)
214215
HW_C_SRCS += common/sched_noop.c
216+
endif
217+
ifeq ($(CONFIG_SCHED_IORR),y)
215218
HW_C_SRCS += common/sched_iorr.c
219+
endif
216220
HW_C_SRCS += hw/pci.c
217221
HW_C_SRCS += arch/x86/configs/vm_config.c
218222
HW_C_SRCS += arch/x86/configs/$(CONFIG_BOARD)/board.c

hypervisor/arch/x86/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ config HYBRID
3737

3838
endchoice
3939

40+
choice
41+
prompt "ACRN Scheduler"
42+
default SCHED_NOOP
43+
help
44+
Select the CPU scheduler to be used by the hypervisor
45+
46+
config SCHED_NOOP
47+
bool "NOOP scheduler"
48+
help
49+
The NOOP (No-Operation) scheduler means there is a strict 1 to 1 mapping
50+
between vCPUs and pCPUs.
51+
52+
config SCHED_IORR
53+
bool "IORR scheduler"
54+
help
55+
IORR (IO sensitive Round Robin) scheduler supports multipule vCPUs running on
56+
on one pCPU, and they will be scheduled by a IO sensitive round robin policy.
57+
58+
endchoice
59+
60+
4061
config BOARD
4162
string "Target board"
4263
help

hypervisor/common/schedule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ void init_sched(uint16_t pcpu_id)
7373
ctl->flags = 0UL;
7474
ctl->curr_obj = NULL;
7575
ctl->pcpu_id = pcpu_id;
76+
#ifdef CONFIG_SCHED_NOOP
7677
ctl->scheduler = &sched_noop;
78+
#endif
79+
#ifdef CONFIG_SCHED_IORR
80+
ctl->scheduler = &sched_iorr;
81+
#endif
7782
if (ctl->scheduler->init != NULL) {
7883
ctl->scheduler->init(ctl);
7984
}

0 commit comments

Comments
 (0)