From 22c6c5c736083500eedc57adf4d4133ebf19fc52 Mon Sep 17 00:00:00 2001 From: Masamichi Takagi Date: Mon, 20 Aug 2018 10:13:24 +0900 Subject: [PATCH] do_syscall: Call schedule() when runq_len > 1 This optimization make the offloading thread quickly yield to another thread. Without this, it yileded only after the interval timer set the rescheduling flag. Change-Id: Ida3b17ed94782d5d1af0185a96b1f50d9db8d244 --- kernel/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/syscall.c b/kernel/syscall.c index 33aa1ae4..b360fbff 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -332,6 +332,7 @@ long do_syscall(struct syscall_request *req, int cpu, int pid) v = get_this_cpu_local_var(); if (v->flags & CPU_FLAG_NEED_RESCHED || + v->runq_len > 1 || req->number == __NR_sched_setaffinity) { do_schedule = 1; }