Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91062
b: refs/heads/master
c: 0297b80
h: refs/heads/master
v: v3
  • Loading branch information
Dhaval Giani authored and Ingo Molnar committed Apr 19, 2008
1 parent 0aa2c6b commit 5a9721d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32cd756a80aaef657ac09c76e6eff3ba65567790
refs/heads/master: 0297b80339d545045490716fa8591b215fdd9458
24 changes: 24 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -8381,10 +8381,34 @@ static u64 cpuusage_read(struct cgroup *cgrp, struct cftype *cft)
return totalcpuusage;
}

static int cpuusage_write(struct cgroup *cgrp, struct cftype *cftype,
u64 reset)
{
struct cpuacct *ca = cgroup_ca(cgrp);
int err = 0;
int i;

if (reset) {
err = -EINVAL;
goto out;
}

for_each_possible_cpu(i) {
u64 *cpuusage = percpu_ptr(ca->cpuusage, i);

spin_lock_irq(&cpu_rq(i)->lock);
*cpuusage = 0;
spin_unlock_irq(&cpu_rq(i)->lock);
}
out:
return err;
}

static struct cftype files[] = {
{
.name = "usage",
.read_uint = cpuusage_read,
.write_uint = cpuusage_write,
},
};

Expand Down

0 comments on commit 5a9721d

Please sign in to comment.