[PATCH] Added atomic operators to make it compile

From: Mats Liljegren
Date: Fri Feb 15 2013 - 07:46:29 EST


---
kernel/sched/core.c | 10 +++++-----
kernel/sched/cputime.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2fad439..5415e85 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8168,8 +8168,8 @@ static int cpuacct_stats_show(struct cgroup *cgrp, struct cftype *cft,

for_each_online_cpu(cpu) {
struct kernel_cpustat *kcpustat = per_cpu_ptr(ca->cpustat, cpu);
- val += kcpustat->cpustat[CPUTIME_USER];
- val += kcpustat->cpustat[CPUTIME_NICE];
+ val += atomic64_read(&kcpustat->cpustat[CPUTIME_USER]);
+ val += atomic64_read(&kcpustat->cpustat[CPUTIME_NICE]);
}
val = cputime64_to_clock_t(val);
cb->fill(cb, cpuacct_stat_desc[CPUACCT_STAT_USER], val);
@@ -8177,9 +8177,9 @@ static int cpuacct_stats_show(struct cgroup *cgrp, struct cftype *cft,
val = 0;
for_each_online_cpu(cpu) {
struct kernel_cpustat *kcpustat = per_cpu_ptr(ca->cpustat, cpu);
- val += kcpustat->cpustat[CPUTIME_SYSTEM];
- val += kcpustat->cpustat[CPUTIME_IRQ];
- val += kcpustat->cpustat[CPUTIME_SOFTIRQ];
+ val += atomic64_read(&kcpustat->cpustat[CPUTIME_SYSTEM]);
+ val += atomic64_read(&kcpustat->cpustat[CPUTIME_IRQ]);
+ val += atomic64_read(&kcpustat->cpustat[CPUTIME_SOFTIRQ]);
}

val = cputime64_to_clock_t(val);
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 50de5bf..2bb998b 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -135,7 +135,7 @@ static inline void task_group_account_field(struct task_struct *p, int index,
ca = task_ca(p);
while (ca && (ca != &root_cpuacct)) {
kcpustat = this_cpu_ptr(ca->cpustat);
- kcpustat->cpustat[index] += tmp;
+ atomic64_add(tmp, &kcpustat->cpustat[index]);
ca = parent_ca(ca);
}
rcu_read_unlock();
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/