summaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorPavankumar Kondeti <pkondeti@codeaurora.org>2017-04-13 18:44:24 +0530
committerPavankumar Kondeti <pkondeti@codeaurora.org>2017-04-14 07:09:53 +0530
commita76d9370e877f0814eccd2962dc18716fd34a86a (patch)
treedcff0c3b8af9cd297ea62c127b90e43a132883e2 /kernel/sched
parent16c1669252515ff1dd4cac51bdf0934bf7f8cdc8 (diff)
core_ctl: Take state_lock while preparing the global_state
global_state file output is prepared by reading the members of CPU and cluster data structures. These members are updated under state_lock, so acquire the same lock while preparing the output. Change-Id: I8cb3ca6f9100a24f0bc9b293d364ad6aa8aabefb Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core_ctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/core_ctl.c b/kernel/sched/core_ctl.c
index 1dde338d30f2..fd7290a5e2a1 100644
--- a/kernel/sched/core_ctl.c
+++ b/kernel/sched/core_ctl.c
@@ -260,6 +260,7 @@ static ssize_t show_global_state(const struct cluster_data *state, char *buf)
ssize_t count = 0;
unsigned int cpu;
+ spin_lock_irq(&state_lock);
for_each_possible_cpu(cpu) {
c = &per_cpu(cpu_state, cpu);
cluster = c->cluster;
@@ -295,6 +296,7 @@ static ssize_t show_global_state(const struct cluster_data *state, char *buf)
count += snprintf(buf + count, PAGE_SIZE - count,
"\tBoost: %u\n", (unsigned int) cluster->boost);
}
+ spin_unlock_irq(&state_lock);
return count;
}