summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@codeaurora.org>2014-08-21 15:10:07 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:00:37 -0700
commit3dcd52ded0d4884ab58add896f3dab97b02e6a70 (patch)
tree753dff3fc3f6f951adff9991d8fadc2392bb74b3 /kernel
parenta37679f0c3eb0723d5422a161eae8102c8bf8fa0 (diff)
sched: Fix compile error
sched_get_busy(), sched_set_io_is_busy() and sched_set_window() need to be defined only when CONFIG_SCHED_FREQ_INPUT is defined, otherwise we get compilation error related to dual definition of those routines Change-Id: Ifd5c9b6675b78d04c2f7ef0e24efeae70f7ce19b Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org> [joonwoop@codeaurora.org: fixed minor conflict in include/linux/sched.h] Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/core.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 308e36d4895c..658f0623c78f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1703,24 +1703,6 @@ static inline void migrate_sync_cpu(int cpu)
sync_cpu = smp_processor_id();
}
-unsigned long sched_get_busy(int cpu)
-{
- unsigned long flags;
- struct rq *rq = cpu_rq(cpu);
-
- /*
- * This function could be called in timer context, and the
- * current task may have been executing for a long time. Ensure
- * that the window stats are current by doing an update.
- */
- raw_spin_lock_irqsave(&rq->lock, flags);
- update_task_ravg(rq->curr, rq, TASK_UPDATE, sched_clock(), 0);
- raw_spin_unlock_irqrestore(&rq->lock, flags);
-
- return div64_u64(scale_load_to_cpu(rq->prev_runnable_sum, cpu),
- NSEC_PER_USEC);
-}
-
static void reset_all_task_stats(void)
{
struct task_struct *g, *p;
@@ -1847,6 +1829,26 @@ void reset_all_window_stats(u64 window_start, unsigned int window_size)
local_irq_restore(flags);
}
+#ifdef CONFIG_SCHED_FREQ_INPUT
+
+unsigned long sched_get_busy(int cpu)
+{
+ unsigned long flags;
+ struct rq *rq = cpu_rq(cpu);
+
+ /*
+ * This function could be called in timer context, and the
+ * current task may have been executing for a long time. Ensure
+ * that the window stats are current by doing an update.
+ */
+ raw_spin_lock_irqsave(&rq->lock, flags);
+ update_task_ravg(rq->curr, rq, TASK_UPDATE, sched_clock(), 0);
+ raw_spin_unlock_irqrestore(&rq->lock, flags);
+
+ return div64_u64(scale_load_to_cpu(rq->prev_runnable_sum, cpu),
+ NSEC_PER_USEC);
+}
+
void sched_set_io_is_busy(int val)
{
sched_io_is_busy = val;
@@ -1879,6 +1881,7 @@ int sched_set_window(u64 window_start, unsigned int window_size)
return 0;
}
+#endif /* CONFIG_SCHED_FREQ_INPUT */
/* Keep track of max/min capacity possible across CPUs "currently" */
static void update_min_max_capacity(void)