diff options
| author | Chris Redpath <chris.redpath@arm.com> | 2017-03-27 18:20:20 +0100 |
|---|---|---|
| committer | Andres Oportus <andresoportus@google.com> | 2017-06-02 08:01:55 -0700 |
| commit | c47d00b57b26a5dc9bca89375dd8a80ee1a7cc5b (patch) | |
| tree | 43c2b2ce273929ac9c099a7e75287fa0bb887dde /kernel/sched/tune.c | |
| parent | 9e3c04bef72b0586e87a2409e0c6d9b96d27da9c (diff) | |
sched/tune: don't use schedtune before it is ready
When EAS is enabled during boot, we have to be careful not to use
schedtune from fair.c before it is ready or it will warn us and we'll
get a traceback in the console.
Change-Id: I1a5cf29b18af626545c636c51219f9ed497c19fa
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Diffstat (limited to 'kernel/sched/tune.c')
| -rw-r--r-- | kernel/sched/tune.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched/tune.c b/kernel/sched/tune.c index 493564816679..86d04caf1684 100644 --- a/kernel/sched/tune.c +++ b/kernel/sched/tune.c @@ -12,7 +12,7 @@ #include "tune.h" #ifdef CONFIG_CGROUP_SCHEDTUNE -static bool schedtune_initialized = false; +bool schedtune_initialized = false; #endif unsigned int sysctl_sched_cfs_boost __read_mostly; @@ -527,6 +527,9 @@ int schedtune_task_boost(struct task_struct *p) struct schedtune *st; int task_boost; + if (!unlikely(schedtune_initialized)) + return 0; + /* Get task boost value */ rcu_read_lock(); st = task_schedtune(p); @@ -541,6 +544,9 @@ int schedtune_prefer_idle(struct task_struct *p) struct schedtune *st; int prefer_idle; + if (!unlikely(schedtune_initialized)) + return 0; + /* Get prefer_idle value */ rcu_read_lock(); st = task_schedtune(p); |
