summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-10-13 12:29:04 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-13 12:29:04 -0700
commita6138ccde2a183256f80f670ad959c3b57f2558c (patch)
tree92e0317629fd3bd3636b54952642fe3d9c88c220 /kernel
parentdaa54e82ab1bdf72a99886bd479b625c36e21eb2 (diff)
parent825b7ef93a28c91d41b370de543b111582de3982 (diff)
Merge "sched: bucketize CPU c-state levels"
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/hmp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sched/hmp.c b/kernel/sched/hmp.c
index a0686ea29243..3d5de8ba70a2 100644
--- a/kernel/sched/hmp.c
+++ b/kernel/sched/hmp.c
@@ -24,6 +24,8 @@
#include <trace/events/sched.h>
+#define CSTATE_LATENCY_GRANULARITY_SHIFT (6)
+
const char *task_event_names[] = {"PUT_PREV_TASK", "PICK_NEXT_TASK",
"TASK_WAKE", "TASK_MIGRATE", "TASK_UPDATE",
"IRQ_UPDATE"};
@@ -99,7 +101,10 @@ sched_set_cpu_cstate(int cpu, int cstate, int wakeup_energy, int wakeup_latency)
rq->cstate = cstate; /* C1, C2 etc */
rq->wakeup_energy = wakeup_energy;
- rq->wakeup_latency = wakeup_latency;
+ /* disregard small latency delta (64 us). */
+ rq->wakeup_latency = ((wakeup_latency >>
+ CSTATE_LATENCY_GRANULARITY_SHIFT) <<
+ CSTATE_LATENCY_GRANULARITY_SHIFT);
}
/*