[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090323135528.ddf795f6.kamezawa.hiroyu@jp.fujitsu.com>
Date: Mon, 23 Mar 2009 13:55:28 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: bharata@...ux.vnet.ibm.com
Cc: linux-kernel@...r.kernel.org, Balaji Rao <balajirrao@...il.com>,
Dhaval Giani <dhaval@...ux.vnet.ibm.com>,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
Li Zefan <lizf@...fujitsu.com>,
Paul Menage <menage@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH -tip] cpuacct: per-cgroup utime/stime statistics - v4
On Mon, 23 Mar 2009 10:05:38 +0530
Bharata B Rao <bharata@...ux.vnet.ibm.com> wrote:
> Hi Ingo,
>
> Here is the v4 of the cpuacct statistics patch to obtain per-cgroup
> system and user times with appropriate tags and complete changelog.
> This applies against the latest -tip plus the cpuacct hierarchy fix v2
> which I posted just now. Could you please include this in -tip ?
>
> Changelog:
>
> v4
> - Remove comments in cpuacct_update_stats() which explained why rcu_read_lock()
> was needed (as per Peter Zijlstra's review comments).
> - Don't say that percpu_counter_read() is broken in Documentation/cpuacct.txt
> as per KAMEZAWA Hiroyuki's review comments.
>
Broken -> isn't safe ? no difference ;)
Can't this help you ?
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
---
Index: mmotm-2.6.29-Mar21/include/linux/percpu_counter.h
===================================================================
--- mmotm-2.6.29-Mar21.orig/include/linux/percpu_counter.h
+++ mmotm-2.6.29-Mar21/include/linux/percpu_counter.h
@@ -62,6 +62,16 @@ static inline s64 percpu_counter_read(st
return fbc->count;
}
+static inline s64 percpu_counter_read_safe(struct percpu_counter *fbc)
+{
+ s64 ret;
+
+ spin_lock(&fbc->lock);
+ ret = fbc->count;
+ spin_unlock(&fbc->lock);
+ return ret;
+}
+
/*
* It is possible for the percpu_counter_read() to return a small negative
* number for some counter which should never be negative.
@@ -114,6 +124,11 @@ static inline s64 percpu_counter_read(st
return fbc->count;
}
+static inline s64 percpu_counter_read_safe(struct percpu_counter *fbc)
+{
+ return fbc->count;
+}
+
static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
{
return fbc->count;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists