lkml.org 
[lkml]   [2010]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] scheduler: cgroups cpuaccouting: Make cpuusage atomic
On Wed, 19 May 2010 20:58:59 +0200
Thomas Renninger <trenn@suse.de> 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@suse.de>
> CC: linux-kernel@vger.kernel.org
> CC: mike@android.com
> CC: menage@google.com
> CC: lizf@cn.fujitsu.com
> CC: containers@lists.linux-foundation.org
> CC: mingo@elte.hu
> CC: peterz@infradead.org
> ---
> 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



\
 
 \ /
  Last update: 2010-05-20 02:49    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site