summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJoonwoo Park <joonwoop@codeaurora.org>2015-04-17 17:16:02 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:02:07 -0700
commita4c475e43db22d2db8bdea676536792cc6b0f724 (patch)
treeadfbed66446eadf8cbb8ba5633ddb6f4f5cebbe1 /include/linux
parenteca78aaf849e531a94483c614ca5e93d8e575532 (diff)
sched: prevent task migration while governor queries CPUs' load
At present, governor retrieves each CPUs' load sequentially. In this way, there is chance of race between governor's CPU load query and task migration that would result in reporting of lesser CPUs' load than actual. For example, CPU0 load = 30%. CPU1 load = 50%. Governor Load balancer - sched_get_busy(cpu 0) = 30%. - A task 'p' migrated from CPU 1 to CPU 0. p->ravg->prev_window = 50. Now CPU 0's load = 80%, CPU 1's load = 0%. - sched_get_busy(cpu 1) = 0% 50% of load from CPU 1 to 0 never accounted. Fix such issues by introducing a new API sched_get_cpus_busy() which makes for governor to be able to get set of CPUs' load. The loads set internally constructed with blocking load balancer to ensure migration cannot occur in the meantime. Change-Id: I4fa4dd1195eff26aa603829aca2054871521495e Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ccfd15287c91..6d3a4cc13f1b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2129,6 +2129,8 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut,
#if defined(CONFIG_SCHED_FREQ_INPUT)
extern int sched_set_window(u64 window_start, unsigned int window_size);
extern unsigned long sched_get_busy(int cpu);
+extern void sched_get_cpus_busy(unsigned long *busy,
+ const struct cpumask *query_cpus);
extern void sched_set_io_is_busy(int val);
#else
static inline int sched_set_window(u64 window_start, unsigned int window_size)