[Devel] Re: [RFC][-mm] [1/2] Simple stats for cpu resource controller
Paul Menage
menage at google.com
Wed Mar 26 12:00:45 PDT 2008
On Wed, Mar 26, 2008 at 11:18 AM, Balaji Rao <balajirrao at gmail.com> wrote:
> +
> +static s64 cpu_cgroup_read_stat(struct cpu_cgroup_stat *stat,
> + enum cpu_cgroup_stat_index idx)
> +{
> + int cpu;
> + s64 ret = 0;
> + for_each_possible_cpu(cpu)
> + ret += stat->cpustat[cpu].count[idx];
On a 32-bit architecture I think this could race with a non-atomic
update that crosses a 32-bit boundary and get a corrupted result.
Paul
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list