User: | Jiri Slaby |
Error type: | Double Lock |
Error type description: | Some lock is locked twice unintentionally in a sequence |
File location: | kernel/sched.c |
Line in file: | 9342 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Undetermined 1
|
Entered: | 2012-02-27 21:22:42 UTC |
9312 for_each_possible_cpu(i) { 9313 u64 *cpuusage = percpu_ptr(ca->cpuusage, i); 9314 9315 /* 9316 * Take rq->lock to make 64-bit addition safe on 32-bit 9317 * platforms. 9318 */ 9319 spin_lock_irq(&cpu_rq(i)->lock); 9320 totalcpuusage += *cpuusage; 9321 spin_unlock_irq(&cpu_rq(i)->lock); 9322 } 9323 9324 return totalcpuusage; 9325} 9326 9327static int cpuusage_write(struct cgroup *cgrp, struct cftype *cftype, 9328 u64 reset) 9329{ 9330 struct cpuacct *ca = cgroup_ca(cgrp); 9331 int err = 0; 9332 int i; 9333 9334 if (reset) { 9335 err = -EINVAL; 9336 goto out; 9337 } 9338 9339 for_each_possible_cpu(i) { 9340 u64 *cpuusage = percpu_ptr(ca->cpuusage, i); 9341 9342 spin_lock_irq(&cpu_rq(i)->lock); 9343 *cpuusage = 0; 9344 spin_unlock_irq(&cpu_rq(i)->lock); 9345 } 9346out: 9347 return err; 9348} 9349 9350static struct cftype files[] = { 9351 { 9352 .name = "usage",