diff --git a/arch/x86_64/tools/mcreboot-smp-x86.sh.in b/arch/x86_64/tools/mcreboot-smp-x86.sh.in index f84ce034..6d66e3d8 100644 --- a/arch/x86_64/tools/mcreboot-smp-x86.sh.in +++ b/arch/x86_64/tools/mcreboot-smp-x86.sh.in @@ -49,8 +49,9 @@ safe_kernel_map="" umask_old=`umask` idle_halt="" allow_oversubscribe="" +time_sharing="time_sharing" -while getopts stk:c:m:o:f:r:q:i:d:e:hO OPT +while getopts stk:c:m:o:f:r:q:i:d:e:hOT: OPT do case ${OPT} in f) facility=${OPTARG} @@ -81,6 +82,14 @@ do ;; O) allow_oversubscribe="allow_oversubscribe" ;; + T) + case ${OPTARG} in + 1) time_sharing="time_sharing" + ;; + 0) time_sharing="" + ;; + esac + ;; \?) exit 1 ;; esac @@ -449,7 +458,7 @@ if ! ${SBINDIR}/ihkosctl 0 load ${KERNDIR}/mckernel.img; then fi # Set kernel arguments -if ! ${SBINDIR}/ihkosctl 0 kargs "hidos $turbo $safe_kernel_map $idle_halt dump_level=${DUMP_LEVEL} $extra_kopts $allow_oversubscribe"; then +if ! ${SBINDIR}/ihkosctl 0 kargs "hidos $turbo $safe_kernel_map $idle_halt dump_level=${DUMP_LEVEL} $extra_kopts $allow_oversubscribe $time_sharing"; then echo "error: setting kernel arguments" >&2 error_exit "os_created" fi diff --git a/kernel/include/process.h b/kernel/include/process.h index 4b0f6472..6f34ee2e 100644 --- a/kernel/include/process.h +++ b/kernel/include/process.h @@ -280,6 +280,7 @@ extern struct list_head resource_set_list; extern mcs_rwlock_lock_t resource_set_lock; extern int idle_halt; extern int allow_oversubscribe; +extern int time_sharing; extern ihk_spinlock_t runq_reservation_lock; /* mutex for cpuid reservation (clv->runq_reserved) */ struct process_hash { diff --git a/kernel/init.c b/kernel/init.c index 2618b983..1b5a3761 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -168,6 +168,12 @@ static void parse_kargs(void) if (ptr) { allow_oversubscribe = 1; } + + /* time_sharing option */ + ptr = find_command_line("time_sharing"); + if (ptr) { + time_sharing = 1; + } } extern void ihk_mc_get_boot_time(unsigned long *tv_sec, unsigned long *tv_nsec); diff --git a/kernel/process.c b/kernel/process.c index 1640a157..387d74b7 100644 --- a/kernel/process.c +++ b/kernel/process.c @@ -91,6 +91,7 @@ ihk_spinlock_t runq_reservation_lock; int idle_halt = 0; int allow_oversubscribe = 0; +int time_sharing = 0; void init_process(struct process *proc, struct process *parent) @@ -3100,6 +3101,10 @@ void set_timer(int runq_locked) int num_running = 0; unsigned long irqstate; + if (!time_sharing) { + return; + } + if (!runq_locked) { irqstate = ihk_mc_spinlock_lock(&(v->runq_lock)); }