Re: [PATCH 2/2] scheduler: cgroups cpuaccouting: Make cpuusageatomic
From: KAMEZAWA Hiroyuki
Date: Wed May 19 2010 - 20:47:25 EST
On Wed, 19 May 2010 20:58:59 +0200
Thomas Renninger <trenn@xxxxxxx> wrote:
> and avoid locking on 32 bit.
> This resolves an ugly dependency in cgroups_cpuaccount.c
> to per_cpu runqueues lock variable.
>
> Signed-off-by: Thomas Renninger <trenn@xxxxxxx>
> CC: linux-kernel@xxxxxxxxxxxxxxx
> CC: mike@xxxxxxxxxxx
> CC: menage@xxxxxxxxxx
> CC: lizf@xxxxxxxxxxxxxx
> CC: containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
> CC: mingo@xxxxxxx
> CC: peterz@xxxxxxxxxxxxx
> ---
> kernel/cgroup_cpuaccount.c | 39 +++++++++------------------------------
> kernel/sched.c | 11 -----------
> kernel/sched.h | 7 -------
> 3 files changed, 9 insertions(+), 48 deletions(-)
> delete mode 100644 kernel/sched.h
>
> diff --git a/kernel/cgroup_cpuaccount.c b/kernel/cgroup_cpuaccount.c
> index 0ad356a..0a53487 100644
> --- a/kernel/cgroup_cpuaccount.c
> +++ b/kernel/cgroup_cpuaccount.c
> @@ -10,8 +10,6 @@
>
> #include <asm/cputime.h>
>
> -#include "sched.h"
> -
> /*
> * CPU accounting code for task groups.
> *
> @@ -23,7 +21,7 @@
> struct cpuacct {
> struct cgroup_subsys_state css;
> /* cpuusage holds pointer to a u64-type object on every cpu */
> - u64 __percpu *cpuusage;
> + atomic64_t __percpu *cpuusage;
Hmmm...how about adding seq_counter for 32bit rather than atomic64_t ?
Thanks,
-Kame
--
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/